Quoth Oleg Goldshmidt on Wed, Jun 09, 1999:
> test -w foo && do_sth_with foo
>
> looks more readable than
>
> [ -w foo ] && do_sth_with foo
For me, [ ] looks more readable, mostly because it has visible
boundaries.
> and is only 1 char longer, and is shorter than
>
> if [ -w foo ]; then do_s
Quoth Vadim Smelyansky on Wed, Jun 09, 1999:
> On Tue, 18 May 1999, Vadim Vygonets wrote:
> VV>Anyway, does anybody in this world use 'test' instead of '['?
> For what? for longer strings in script? :)
>
> FYI usually "/usr/bin/[" it is hardlink to "/usr/bin/test"
I know it. And in sane
Vadim Smelyansky <[EMAIL PROTECTED]> writes:
> On Tue, 18 May 1999, Vadim Vygonets wrote:
>
> VV>Anyway, does anybody in this world use 'test' instead of '['?
> For what? for longer strings in script? :)
test -w foo && do_sth_with foo
looks more readable than
[ -w foo ] && do_sth_with
On Tue, 18 May 1999, Vadim Vygonets wrote:
VV>Anyway, does anybody in this world use 'test' instead of '['?
For what? for longer strings in script? :)
FYI usually "/usr/bin/[" it is hardlink to "/usr/bin/test"
--
Vadim Smelyansky (AKA Proglot) cellular:+972-54-876933
Wide Networking S
Ariel Biener wrote:
> To all the helpfull people:
I don't care to participate in religious wars, which is basically what this
thread is about. But factual mistakes need to be corrected.
> I believe that when you create shell scripts, they'd better be generic,
> unless there is a special reason
On Tue, 18 May 1999, Adam Morrison wrote:
To all the helpfull people:
I believe that when you create shell scripts, they'd better be generic,
unless there is a special reason, and if there is, it should be documented
in the script. (like using functions, which work in bash/ksh, but not in
the
On Tue, May 18, 1999 at 08:09:40PM +0300, Vadim Vygonets wrote:
> Anyway, does anybody in this world use 'test' instead of '['?
[gaal@derain ~]$ ls -l /usr/bin/[ /usr/bin/test
lrwxrwxrwx 1 root root4 Mar 26 00:50 /usr/bin/[ -> test
-rwxr-xr-x 1 root root16856 Aug
Ariel Biener wrote:
> Which will result in the script fo fail if $PARAM is undefined.
>
> Vadim's suggestion wasn't just a matter of semantics.
>
> --Ariel
> > Vadim Vygonets <[EMAIL PROTECTED]> writes:
> >
> > > > [ "$PARAM" != "SOMETHING" ] || {
> > > > ;}
> > > I think that it's better to do
Quoth Ariel Biener on Tue, May 18, 1999:
> Which will result in the script fo fail if $PARAM is undefined.
>
> Vadim's suggestion wasn't just a matter of semantics.
I don't think that on all Unices "$PARAM" (enclosed in double
quotes) will yield nothing. On some Unices it will yield an
empty ar
Ariel Biener <[EMAIL PROTECTED]> writes:
> On 18 May 1999, Chmouel Boudjnah wrote:
>
>
> Which will result in the script fo fail if $PARAM is undefined.
Not quite:
$ echo $SHELL
/bin/bash
$ if [ "$foobar" != "something" ] ; then echo nothing; fi
nothing
$ ksh
$ if [ "$foobar" != "something"
On 18 May 1999, Chmouel Boudjnah wrote:
Which will result in the script fo fail if $PARAM is undefined.
Vadim's suggestion wasn't just a matter of semantics.
--Ariel
> Vadim Vygonets <[EMAIL PROTECTED]> writes:
>
> > > [ "$PARAM" != "SOMETHING" ] || {
> > > ;}
> > I think that it's better to
Vadim Vygonets <[EMAIL PROTECTED]> writes:
> > [ "$PARAM" != "SOMETHING" ] || {
> > ;}
> I think that it's better to do:
> if [ "X$PARAM" != "XSOMETHING" ]; then .
Yes you right it's more unix, but i usually use the "$PARAM" !=
"SOME".
--
MandrakeSoft http://www.mandrakesoft.com
Quoth Chmouel Boudjnah on Tue, May 18, 1999:
> [ "$PARAM" != "SOMETHING" ] || {
> ;}
I think that it's better to do:
if [ "X$PARAM" != "XSOMETHING" ]; then .
Or, if you check for an enpty string,
if [ "X$PARAM" != "X" ]; then .
Vadik.
--
The ill-formed Orange
Fails to satisfy the eye:
Mike Almogy <[EMAIL PROTECTED]> writes:
> Does any one know how can i check if a varible contain any data ,using
> sh script.
>
> something like if ($param ne ""){} in perl.
man test?
E.g.
if [ "$PARAM" != "" ]
then ...
else ...
fi
or
if [ -z "$PARAM" ]
then ...
else ...
fi
Hi,
Does any one know how can i check if a varible contain any data ,using
sh script.
something like if ($param ne ""){} in perl.
Thanks.
Mike Almogy
Mofet System Administrator.
Pho :972-03-6901417
Cel :972-052-562237
Fax :972-03-6901414
15 matches
Mail list logo