[NBLUG/talk] shell scripting help

Lincoln Peters anfrind at gmail.com
Tue Jun 10 16:38:58 PDT 2008


On Tue, Jun 10, 2008 at 4:30 PM, Sean <seanvanco at gmail.com> wrote:
> It seems that the problem is occurring after the sleep command or at
> the beginning of the script. I'd be very surprised if it's caused by
> this line:
>
> time=`expr $time + 1`
>
> line, so it must then be the
>
> if [ -z "$1" ]; then
>
> line. But again, I'm too rusty to know for sure, and I have no idea
> what that "-z" on the "if" line does. I pulled it from a sample
> script.

It executes the associated block of code if $1 (the first argument to
the script) is a string of length zero.  I think it's just checking
whether or not the script received the expected arguments, and
terminates the script if it didn't (in which case it doesn't need to
be inside the loop).

I'd be really surprised if that block of code was taking 7 seconds to
execute.  Are you sure it's not the "ping" command taking 7 seconds to
time out, or something like that?


-- 
Lincoln Peters
<anfrind at gmail.com>



More information about the talk mailing list