[clug] Ever received a .dat file from an <other OS> user?
Peter Barker
pbarker at barker.dropbear.id.au
Sat Jan 16 03:39:16 MST 2010
On Sat, 16 Jan 2010, steve jenkin wrote:
> Kevin Pulo wrote on 16/01/10 9:01 PM:
>
>> I thought there was a shopt or set option which is the equivalent of
>> "use strict" (and tcsh behaves this way by default when unset
>> variables are expanded), but I can't seem to find anything for it...
> Perhaps:
> set -o nounset
> or
> set -u
Excellent! Not what's been clouding the back of my mind (I think!), but a
very nice thing to know. More boilerplace for my scripts....
> Haven't tested in a script.
---------------------
pbarker at milligan:~$ cat test.sh
#!/bin/sh
set -o nounset
FOO="xyzzy"
echo "$FOO"
echo "$BAR";
pbarker at milligan:~$ sh ./test.sh
xyzzy
./test.sh: line 9: BAR: unbound variable
pbarker at milligan:~$
-----------------
> s
Thanks,
--
Peter Barker | Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au | You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams
More information about the linux
mailing list