[ubuntu-za] Script error

Russell Cloran russell at rucus.net
Tue Apr 14 14:14:26 BST 2009


Hi,

On Tue, Apr 14, 2009 at 3:03 PM, Walter Leibbrandt
<walter+ubuntuza at translate.org.za> wrote:
> ... Or zero.

An asterisk glob will never "expand" to zero length, but will rather
leave the * as is...

russell at stratus:~/tmp$ touch ubuntu
russell at stratus:~/tmp$ echo *buntu
ubuntu
russell at stratus:~/tmp$ echo *Ubuntu
*Ubuntu

I promise I didn't cheat and create a file called "*Ubuntu" ;)


> The following seems to always echo 1, ie. -f returns true if no
> parameters are specified:
> if [ -f ]; then echo 1; else echo 0; fi

Of course, an asterisk glob which was not expanded means that the file
doesn't exist and your -f will be false anyways.

Russell
-- 
echo http://russell.rucus.net/spam/ |  sed 's,t/.*,t,;P;s,.*//,,;s,\.,@,;'



More information about the ubuntu-za mailing list