Results 1 to 3 of 3
Hello Linux ppl!
I need some help with processing wildcard character * in my bash script. My script writes:
OUTPUT=$(du -sh backup* 2>&1)
Whenever this line is executed, backup* is ...
- 01-15-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 6
Escaping wildcard character * in bash script
Hello Linux ppl!
I need some help with processing wildcard character * in my bash script. My script writes:
OUTPUT=$(du -sh backup* 2>&1)
Whenever this line is executed, backup* is interpreted explicitly as backup* instead of all files starting with the word backup.
Thanks in advance!
- 01-15-2010 #2
That is interesting, as mine does not:
Perhaps you forgot that you are storing the output of that command in $OUTPUT, and forgot to echo it?Code:alex@danu:~$ OUTPUT=$(du -sh down* 2>&1); echo $OUTPUT 404M downloads
DISTRO=Arch
Registered Linux User #388732
- 01-15-2010 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 6
Thanks for your response.
It works differently if written in a script file.
The solution goes like this: OUTPUT=$( du -sh backup* 2>&1 )
I have added spaces after the opening parenthesis and before the closing parenthesis.
I hope this help others with the same problem.


Reply With Quote