My first Bash script : trouble with *
From: Vincent Schmid (mightberead_at_econophone.ch)
Date: 04/12/05
- Next message: David: "Re: simple question about dns lookup"
- Previous message: Tauno Voipio: "Re: memory usage by a process"
- Next in thread: Dances With Crows: "Re: My first Bash script : trouble with *"
- Reply: Dances With Crows: "Re: My first Bash script : trouble with *"
- Reply: mjt: "Re: My first Bash script : trouble with *"
- Reply: Alan Connor: "Re: My first Bash script : trouble with *"
- Reply: Chris F.A. Johnson: "Re: My first Bash script : trouble with *"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 12 Apr 2005 22:35:39 +0200
Hello,
Trying to write my first script with bash, I have declared a variable
which holds a path :
declare -r SOURCE_PATH=/home/source
Now, I want to know wether /home/source is empty or not. It seems that
something like test -e /home/source/* would work...
In order to concatenate /* to my path, I declare a variable ANY_FILE
like this :
declare ANY_FILE='/*'
ANY_FILE=$SOURCE_PATH$ANY_FILE
Now I test the result :
echo $ANY_FILE
To my surprise, this last line gives the list of the files which are in
/home/source ! I have tried many things to get this "*" to work
correctly with no sucess.
Some help would be appreciated,
Sincerely,
Vincent
- Next message: David: "Re: simple question about dns lookup"
- Previous message: Tauno Voipio: "Re: memory usage by a process"
- Next in thread: Dances With Crows: "Re: My first Bash script : trouble with *"
- Reply: Dances With Crows: "Re: My first Bash script : trouble with *"
- Reply: mjt: "Re: My first Bash script : trouble with *"
- Reply: Alan Connor: "Re: My first Bash script : trouble with *"
- Reply: Chris F.A. Johnson: "Re: My first Bash script : trouble with *"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|