[CentOS] simple if statement

2009-02-27 Thread Tom Brown
Hi Below if $remaining is empty i want the if to finish - what is it i need to put in SOMETHING? if [ "$remaining" = "" ] ; then SOMETHING ; else kill -9 $remaining fi thanks? ___ CentOS mailing list CentOS@centos.org h

Re: [CentOS] simple if statement

2009-02-27 Thread John R. Dennison
On Fri, Feb 27, 2009 at 11:14:01AM +, Tom Brown wrote: > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fi if [ "${remai

Re: [CentOS] simple if statement

2009-02-27 Thread Ralph Angenendt
Tom Brown wrote: > Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fi if [ "x${remaining}" != "x" ] ; then kill -9

Re: [CentOS] simple if statement

2009-02-27 Thread Miguel Ángel MF
You have to put in NOTHING, i.e.: if [ "$remaining" = "" ] ; then ; else kill -9 $remaining fi A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

Re: [CentOS] simple if statement

2009-02-27 Thread Per Qvindesland
I normally do it this way: if (length($remaining) == 0) { &do_exit; } Per Hi Below if $remaining is empty i want the if to finish - what is it i need to put in SOMETHING? if [ "$remaining" = "" ] ; then SOMETHING ; else kill -9 $remaining fi ___

Re: [CentOS] simple if statement

2009-02-27 Thread William L. Maltby
On Fri, 2009-02-27 at 11:14 +, Tom Brown wrote: > Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fi if [ -n "$remaining" ]

Re: [CentOS] simple if statement

2009-02-27 Thread William L. Maltby
> > # Initialize remaing list and then > set "$remaining" # If empty $1 is null > while [ -n "$1" ] ; do >echo "$1" # remove this >kill -9 $ s/\$/$1/ # OOPS! >shift > done > > $ remaining="9997 9998 " > $ while [ -n "$1" ] ; do > >echo "$1" > >shift > > done > 9997 999

Re: [CentOS] simple if statement

2009-02-27 Thread Kevin Krieser
You don't really need to prepend the x if the $remaining is in quotes, do you? If you didn't use quotes, then you could end up with a error if $remaining isn't set. On Feb 27, 2009, at 5:24 AM, Ralph Angenendt wrote: > Tom Brown wrote: >> Hi >> >> Below if $remaining is empty i want the if t

Re: [CentOS] simple if statement

2009-02-27 Thread Stephen Harris
On Fri, Feb 27, 2009 at 11:14:01AM +, Tom Brown wrote: > Hi > > Below if $remaining is empty i want the if to finish - what is it i need > to put in SOMETHING? > > if [ "$remaining" = "" ] ; then > SOMETHING ; > else > kill -9 $remaining > fi A ":" on it's ow

Re: [CentOS] simple if statement

2009-02-27 Thread Ralph Angenendt
Kevin Krieser wrote: > You don't really need to prepend the x if the $remaining is in quotes, > do you? If you didn't use quotes, then you could end up with a error > if $remaining isn't set. Probably. It's just something I'm used to do :) Cheers, Ralph pgp10DbrpyejE.pgp Description: PGP

Re: [CentOS] simple if statement

2009-02-27 Thread Tom Brown
> A ":" on it's own will do what you want. > > if [ "$remaining" = "" ] > then > : > else > kill -9 $remaining > fi > > But better would be > > if [ -n "$remaining" ] > then > kill -9 $remaining > fi > > thanks to all for the suggestions __

Re: [CentOS] simple if statement

2009-02-27 Thread William L. Maltby
On Fri, 2009-02-27 at 15:42 +0100, Ralph Angenendt wrote: > Kevin Krieser wrote: > > You don't really need to prepend the x if the $remaining is in quotes, > > do you? If you didn't use quotes, then you could end up with a error > > if $remaining isn't set. > > Probably. It's just something

Re: [CentOS] simple if statement

2009-02-27 Thread Scott Silva
on 2-27-2009 3:32 AM � spake the following: > You have to put in NOTHING, i.e.: > > if [ "$remaining" = "" ] ; then > �� � � � � ; > � � � �else > � � � � � �kill -9 $remaining > fi > > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thi