allbery@ncoast.UUCP (Brandon Allbery) (10/28/85)
Expires: Quoted from <2000031@ccvaxa> ["Re: In sh, is '[' a portable synony"], by preece@ccvaxa.UUCP... +--------------- | > if test -f "$1" <= 15 keystrokes + <CR> | > vs. | > if [ -f "$1" ] <= 14 keystrokes + <CR> | > | > Which is more readable? Note that the spaces around [] are MANDATORY. | > /* Written 9:57 am Oct 15, 1985 by carl@bdaemon.UUCP in | > ccvaxa:net.unix-wizards */ | ---------- | Well, readability is very much in the eye of the beholder. I much | prefer the second form, which I gather you think is less readable. +--------------- In general, when I am using the math/binary ops I use [, but when I want to use the file predicates I use test. Thus: if [ $expr -gt 5 ]; then but if test -s /tmp/toMl$$; then -- ``Youth, you are guilty of muddy thinking.'' Mentor ncoast!allbery@Case.CSNet (ncoast!allbery%Case.CSNet@CSNet-Relay.ARPA) ..decvax!cwruecmp!ncoast!bsa -- maybe ..genrad!mit-eddie!futura!ncoast!allbery 6615 Center St., Mentor, OH 44060 (I moved) --Phone: +01 216 974 9210 CIS 74106,1032 -- MCI MAIL BALLBERY (WARNING: I am only a part-time denizen...) ncoast is dead, long live ncoast!