My first Bash script : trouble with *

From: Vincent Schmid (
Date: 04/12/05

Date: Tue, 12 Apr 2005 22:35:39 +0200


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='/*'


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,

Relevant Pages

  • Re: Trying to mimic perl with declarations
    ... > I need to declare a method with 2 strings as input. ... > being empty and not needed to be place in the parameters when called. ... > bool x ...
  • Re: Why wont my loop recognize empty cells?
    ... I think Gary''s Student was on the right track, he just used the same wrong variable that you did. ... > Dim Last_Cell, First_Cell as Range ... you will have to show us the code you use to "declare what ... >>> I'm trying to have a loop that finds empty cells in a range. ...
  • Re: pl/sql: test if record is empty
    ... I apparently overlooked it in the manuals - so please be patient ... ... How can I test if a record is empty? ...   o_rec mytab%ROWTYPE; ... SQL> declare ...
  • Re: for conditional handling question
    ... (And bring into existence ... any variables it happens to declare These variables live as ... It just happens that evaluating an empty ...
  • Re: Work with date
    ... "Bruno" schrieb: ... > How do I check if a date variable is empty? ... if I declare a variable like this ... > dim d as Date ...