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
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
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
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?
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
___
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" ]
>
> # 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
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
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
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
> 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
__
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
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
13 matches
Mail list logo