rgds
Jaya
> I'm having a problem getting a shell variable to include a wild card
> character, without the unix environment expanding the variable. Basically I
> would like the variable to reflect the string "filename.*" However,
> although I am aware that you can preceed the * by another character which
> will stop the unix environment from interpretting it, I'm at a loss as to
> what that particular character is.
$ x='filename.*'
$ echo $x
filename.*
-or-
$ x=filename.\*
$ echo $x
filename.*
for csh:
41: set x='filename.*'
42: echo "$x"
filename.*
....I think you get the picture.
A word of caution ... make sure you know how the shell is going to
evaluate this before you do anything "permanent" with it.
Hope it helps,
Ted
>rgds
>Jaya
>>I'm having a problem getting a shell variable to include a wild card
>>character, without the unix environment expanding the variable. Basically
>I
>>would like the variable to reflect the string "filename.*" However,
>>although I am aware that you can preceed the * by another character which
>>will stop the unix environment from interpretting it, I'm at a loss as to
>>what that particular character is.
>> I'm having a problem getting a shell variable to include a wild card
>> character, without the unix environment expanding the variable. Basically I
>> would like the variable to reflect the string "filename.*" However,
>> although I am aware that you can preceed the * by another character which
>> will stop the unix environment from interpretting it, I'm at a loss as to
>> what that particular character is.
> For sh the command would be:
> $ x='filename.*'
> $ echo $x
> filename.*
> -or-
> $ x=filename.\*
> $ echo $x
> filename.*
--
Eric Amick
Columbia, MD
1. Using the * wildcard in a shell script path variable
I'm trying to set up a shell path variable using the * wildcard so I
don't have to explicitly identify each subdirectory in a path.
Unfortuately, it's not working. Here's the detail:
I have the following directory structure:
/applic/oraweb/dir_one/web_forms
/applic/oraweb/dir_two/web_forms
/applic/oraweb/dir_three/web_forms
/applic/oraweb/dir_four/web_forms
In a shell script I am setting a variable named FORMS60_PATH as listed
below. When I use a wildcard * in the /applic/oraweb/*/web_forms
section, it resolves it literally when the shell is executed.
FORMS60_PATH=$ORACLE_HOME/forms60:/$ORACLE_HOME/tools/forms:/applic/oraweb/ When I replace the * wildcard with the actual values, (see below), FORMS60_PATH=$ORACLE_HOME/forms60:/$ORACLE_HOME/tools/forms:/applic/oraweb/ Thanks! Carl DiPasquale 3. Expanding a shell variable that may contain shell variables. 5. IFS shell variable & /usr/include/sysexits.h EXITCODE 75 6. Help! Cannot print from RH6 to Win98 printer 7. tcsh 6.03 isn't expanding wildcard characters on HP-UX 9.01 10. Wildcard characters in Apache 1.1.1 scriptalias? 11. Passing Quoted Wildcard Characters to a C Program 12. sed and wildcard meta characters
export FORMS60_PATH
everything works fine. Question is: Is there a way to use a wildcard
in this context so I don't have to keep modifying my shell script each
time a new directory is added?
export FORMS60_PATH
Oracle DBA
Visteon Corporation