[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Backquote Mystery
From: |
Com MN PG P E B Consultant 3 |
Subject: |
Backquote Mystery |
Date: |
Thu, 23 Mar 2006 15:37:25 +0100 |
While hunting a bug in my script, I stumbled over an effect involving
the usage of
backquote and grep, which completely puzzles me. To reproduce the
effect, execute
first the following four commands, which create a small directory tree
in your
working directory and set the bash variable 'e':
mkdir -p dirx/sub/f
cd dirx
touch x
e=$('ls' *)
Wenn you now do echo $e, you should get the following output:
x sub: f
And here comes the mystery part. Execute the following two commands:
echo g|grep "$e"
echo g|grep "x sub: f"
Could some kind soul explain to me, why the first grep matches?
BTW, BASH_VERSION is "2.05b.0(1)-release"
Ronald
- Backquote Mystery,
Com MN PG P E B Consultant 3 <=