[Gloucs] scripting

Richard Mellersh gloucs at mailman.lug.org.uk
Fri May 30 21:30:00 2003


On Thursday 29 May 2003 11:53 pm, Paul Broadhead wrote:
> Steve Searle <mail@stevesearle.com> wrote:
> > Around 10:58pm on Thursday, May 29, 2003 (UK time), Richard Mellersh 
scrawled:
> > > Can anyone help?
> > >
> > > I'm still trying to sort out some old stuff that never worked on older
> > > systems.  There is something wrong with line 4 inside the [brackets] -
> > > expects a "unary operator".
> > >
> > > #! /bin/bash
> > > typeset -i num
> > > num=ifconfig | grep eth1 | wc -l
> >
> > I don't think this line is returning an integer.  After adding spaces
> > after/before the [s, I got the unary operator message.  Setting num to 0
> > removes the error message, and echoing num after it has been set
> > displays "<whitespace>0".
>
> Should the line
>
> num=ifconfig | grep eth1 | wc -l
>
> be
>
> num=$(ifconfig | grep eth1 | wc -l)
>
> or
>
> num=`ifconfig | grep eth1 | wc -l`
>
> to actually execute the command.
>
> Could be wrong, its past my bedtime....
>
> Paul
>
> _______________________________________________
> gloucs mailing list
> gloucs@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/gloucs
Thanks for all your help, I have it working now. It was the spaces ( or lack 
of ).
I now have the interface working but I don't know what I can do with it? I 
have a feeling that if I post to the Zaurus lists I'll get flamed for using 
such an old device as the SL 5000d.
All I want to do with it is move pictures to and from the SD-card which fits 
the digital camera?
Any Ideas what to try? - I already tried ftp and telnet - no good - don't 
work.

BUT I can `ping' all round the world now and thats a first!

RM