[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sh script Q
Vadim Smelyansky <jim@widenet.co.il> 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 foo
and is only 1 char longer, and is shorter than
if [ -w foo ]; then do_sth_with foo; fi
I actually use the first form in my scripts and prefer it to the
second one). Otherwise, just kidding ;-)
--
Oleg Goldshmidt goldshmt@netvision.net.il
BLOOMBERG L.P. (BFM) oleg@bfr.co.il