Mermouy / bashscripts

Automatically exported from code.google.com/p/bashscripts
GNU General Public License v3.0
1 stars 2 forks source link

Sleep problem #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, thanks for your useful script !
However I noticed an error concerning the sleep usage.
When gmailchecker is launched via a terminal, an error is displayed saying :
"sleep: intervalle de temps « 120,000000 » incorrect
Saisissez « sleep --help » pour plus d'informations."

Unfortunately, I'm french, so I'll describe you the error displayed above. It's 
telling us that "sleep" isn't well used.

So, I decided to look inside your script and I think it's a yad-relative 
problem. In fact, the INTERVAL variable contains the value 120,000000 so 
"sleep" can't understand it, you ought to set it to 120.000000 instead.

I solved this problem by replacing the last line of your script :
sleep ${INTERVAL:=300} to
sleep ${INTERVAL//,/.}

I don't understand the :=300, but I'm sure you'll find a way to set it back ;)

Original issue reported on code.google.com by boitut...@gmail.com on 2 Jan 2014 at 5:47

GoogleCodeExporter commented 9 years ago
Thanks for your comment.  I think the problem is the locale on your system.  In 
English, it uses period as decimal point but in French it uses comma.  What do 
you see if you type "locale".  I got this
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I'm not sure why yad uses French locale and bash uses English locale.  Your fix 
works for your situation but won't work for all I think.  I'm not sure how to 
fix this yet so I'll leave the script as is for now.

Tri

Original comment by tri...@gmail.com on 3 Jan 2014 at 1:46