Hi, why doesn't the second command work? (Trying to move all files into
a newly created directory.)
$ mkdir dhclient
$ mv !(dhclient) !$
bash: !: event not found
--
Yang Zhang
http://www.mit.edu/~y_z/
Chet Ramey wrote:
Yang Zhang wrote:
Hi, why doesn't the second command work? (Trying to move all files into
a newly created directory.)
$ mkdir dhclient
$ mv !(dhclient) !$
bash: !: event not found
It doesn't work because enabling the `extglob' option doesn't cause bash
variables set to
empty arrays and unset variables are the same).
As a result I'm forced to use "${@:-}" or something like that everywhere
I use "$@" (which is really everywhere). Is there any other way around
this? Any way to get a more selective nounset? Thanks in advance.
--
Yang Zhang
http://www.mit.edu/~y_z/
Mike Frysinger wrote:
On Monday 29 June 2009 04:54:52 Yang Zhang wrote:
Hi, I like using nounset for stricter scripts, but an annoyance is that
anytime I use "$@" and it's empty, I get an error, when (to me,
cognitively) it is not "unset" (as in someone *forgot* to se
Why does assigning to multiple variables on the same line exhibit
sequential consistency normally but not for local variables?
#!/usr/bin/env bash
f() {
local a=$1 b=$a
c=0 d=$c
echo $b
echo $d
}
f x
# Output:
# b=
# d=0
--
Yang Zhang
http://www.mit.edu/~y_z/