Re: Learning Scripting

2006-05-25 Thread Michelle Konzack
Am 2006-05-15 23:18:11, schrieb Anil Gupte: > BlankHi all: > > what am I doing worng here? Here is my script: > ** > #!/bin/sh > > msgtest="jumbalaya" > > test1=$(ps ax) > > echo $test1>psout.temp > > check=$(grep -i $msgtest psout.temp) > count=$(#check) > > if [ count>0

Re: Learning Scripting

2006-05-17 Thread Bob McGowan
tioned grep -v but now I know how to use it too. Thanx Much! Anil Gupte www.keeninc.net www.icinema.com - Original Message - From: "Michael Marsh" <[EMAIL PROTECTED]> To: Sent: Tuesday, May 16, 2006 5:21 PM Subject: Re: Learning Scripting On 5/16/06, Anil Gupte <[E

Re: Learning Scripting

2006-05-17 Thread Magnus Therning
On Wed, May 17, 2006 at 04:09:45PM +0530, Anil Gupte wrote: >Beautiful! We were just talking about this and someone mentioned grep -v but >now I know how to use it too. Another tip, use pgrep instead of ps, it removes the need to use 'grep -v' altogether :-) /M -- Magnus Therning

Re: Learning Scripting

2006-05-17 Thread Anil Gupte
1 PM Subject: Re: Learning Scripting On 5/16/06, Anil Gupte <[EMAIL PROTECTED]> wrote: The idea was the system cannot start the X-Server sometimes when the power goes off unexpectedly. So, if an error message is found the system should be shutdown nicely and then when it reboots, it runs an fs

Re: Learning Scripting

2006-05-16 Thread Michael Marsh
On 5/16/06, Anil Gupte <[EMAIL PROTECTED]> wrote: The idea was the system cannot start the X-Server sometimes when the power goes off unexpectedly. So, if an error message is found the system should be shutdown nicely and then when it reboots, it runs an fsck and cleans up. The second set of ch

Re: Learning Scripting

2006-05-16 Thread Anil Gupte
f [ $count20 -gt 0 ] then count2=0 fi if [ $count1 -gt 0 ] || [ $count2 -gt 0 ] then echo "Found it!" shutdown -r now else echo "Not found!" fi Anil Gupte www.keeninc.net www.icinema.com - Original Message - From: "Andrew Sackville-West" <

Re: Learning Scripting

2006-05-15 Thread Andrew Sackville-West
On Mon, May 15, 2006 at 11:18:11PM +0530, Anil Gupte wrote: > BlankHi all: > > what am I doing worng here? Here is my script: > ** > #!/bin/sh > > msgtest="jumbalaya" > > test1=$(ps ax) > > echo $test1>psout.temp > > check=$(grep -i $msgtest psout.temp) > count=$(#check) -

Re: Learning Scripting

2006-05-15 Thread Michael Marsh
On 5/15/06, Anil Gupte <[EMAIL PROTECTED]> wrote: BlankHi all: what am I doing worng here? Here is my script: [...] count=$(#check) count=${#check} With parentheses, the shell is interpreting "#check" as a command, which is a commented-out line. With braces, it's a parameter evaluation.

Learning Scripting

2006-05-15 Thread Anil Gupte
BlankHi all: what am I doing worng here? Here is my script: ** #!/bin/sh msgtest="jumbalaya" test1=$(ps ax) echo $test1>psout.temp check=$(grep -i $msgtest psout.temp) count=$(#check) if [ count>0 ] then echo "Found it!" #shutdown -r now else echo "Not found!