Picking a character from a word

Leslie Mikesell les at chinet.UUCP
Fri Apr 29 02:55:27 AEST 1988


In article <905 at cresswell.quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>is false.  But let $string be "-z", and you get an error message!  You
>would expect that using "-n $string" would eliminate this ambiguity,
>but it introduces another: try string="="!.

The work-around that I have seen is:

if test "X$string" = "X"

Now, does someone have an easy way to test if a directory contains any
files or not?

  Les Mikesell



More information about the Comp.unix.questions mailing list