Eddy Petrişor wrote:
On 2/27/06, Giacomo A. Catenazzi <[EMAIL PROTECTED]> wrote:
Eddy Petrişor" wrote:
an other maybe better version

at the beginning (only on home computer)
if [ "${SLEEPTIME}" ] ; then
   SLEEPCMD="sleep ${SLEEPTIME} || true"

I don't understand the reason behind the part with "|| true"

This should do:
SLEEPCMD="type sleep && sleep ${SLEEPTIME}"
I usually put || true because I use a lot of "-e" shell script.
But I agree, in this (the nested) script is not necessary.


Yes, but is a lot uncleaner than testing for the existance of the
cammand, then running it if it does exist.
But it is the standard way. (IIRC).
The shell (aka the system library) should return 127 if command
doesn'exists.

Opps. I think the right command should be:
SLEEPCMD="sleep ${SLEEPTIME}"

Note: I din't understood what has changed, but the test for the
existance of sleep should not miss as it would break the whole
download script instead of gracefully failing ;-)

I don't understand.
It would write an error message every at sleep message
(OK, not the right thing to do).
So I think a test at the beginning of the (nested) script
would be better. And the eventually (but single) error message
is correct, so that user see that it want to use sleep (via option),
but sleep doesn't exits.

I guess this is ok and has no noise.
type is not a POSIX/SuS command, so I think it is better to avoid it.
[ http://www.unix.org/single_unix_specification/ ]
On a system without "type" (if such system exists) will not
execute "sleep".
Anyway this is not a big issue, because this sleep function is not an
inportant option, and I think it is resonable to require sane
implementation to use this extra feature.

type is present in the specification (not sure if this implies that is
POSIX) - see "Utilities" in "Shel&Utilities".

oops. I didn't see it.


So I would apply any your solution that works on normal case.
Only the sleep period issue should be fixed first.
Have you made any changes from the zip you send previously?

No, no further changes.


ciao
        cate


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to