With the if statement:
if
How can I make it so it accepts a wildcard after the ${CURR_DAY_MONTH} variable?
Putting
a -f /webtrends/SUN/mrw2/access.${CURR_DAY_DAY}${CURR_DAY_MONTH}*
won't work, right? I think I need some kind of special character so it knows the wildcard is... (3 Replies)
Dear all,
i dont know how to split one variable value in 2 variable. please send me any example.
variable1= "abcde developer"
now i want to seperate the values and seperator is space. (6 Replies)
I am new to unix and would appreciate if someone could help.
I have an environment variable SourceFilePath=/db1/Src/test set on the unix server.
I want to expand this SHELL variable in a file using any command sed, awk etc
File contents is as follows:
var=$SourceFilePath/file.txt
... (2 Replies)
Probably a stupid question... how do I use a wildcard in a variable in zsh? If I do:
var=*
echo $var
in bash, it will print all files/directories in the current directory. If I do it in zsh, it will only output an asterisk without the wildcard functionality. Thanks in advance! (1 Reply)
Hi,
I'm using a for loop reading from an input file that contains files, whose path includes a variable name.
But the for loop doesn't expand the variable and therefore can't find the file.
Here's an example:
File BACKUPFILES
/home/John/alpha
/home/Sue/beta... (8 Replies)
I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash".
sed -e 's/<HOME_DIRECTORY>/'$HOME'/'This gives me the following error:
sed: -e expression #1, char 21: unknown option to `s'Obviously this is... (2 Replies)
Hello,
so i'm making a script, using dynamic variables and trying to expand them. So far it hasn't worked out too well so it seems that I need some help from you, the elite.
Example:
#!/bin/sh
counter=0
until (($counter>5))
counter2=1
until (($counter2>6)); do
if ;... (5 Replies)
Experts,
I want to set value of variables like this in bash shell:
i=5 ; L=100
I want variable d5 (that is d(i) ) to be assign the value of $L ,
d$i=$L ; echo $d5
Not working
Thanks., (3 Replies)
Hello,
Can you please help here?
DAY=$1
MONTH_MONDAY_YEAR = 1 2 3 4
for i in ${MONTH_${DAY}_YEAR}
do
echo ${i}
done
./test.sh MONDAY
./test.sh: line 3: MONTH_MONDAY_YEAR: command not found
./test.sh: line 10: ${MONTH_${DAY}_YEAR}: bad substitution (6 Replies)
I have a lot of files with keywords and unique names. I'm using a shell script to refer to a simple pattern file with comma separated values in order to match on certain keywords. The problem is that I don't understand how to handle the wildcard values when I want to skip over the unique names.
... (5 Replies)
Discussion started by: abercrom
5 Replies
LEARN ABOUT OPENSOLARIS
unset
set(1F) FMLI Commands set(1F)NAME
set, unset - set and unset local or global environment variables
SYNOPSIS
set [-l variable [=value]] ...
set [-e variable [=value]] ...
set [-ffile variable [=value]]... ...
unset -l variable...
unset -f file variable...
DESCRIPTION
The set command sets variable in the environment, or adds variable=value to file. If variable is not equated it to a value, set expects the
value to be on stdin. The unset command removes variable. Note that the FMLI predefined, read-only variables (such as ARG1), may not be set
or unset.
Note that at least one of the above options must be used for each variable being set or unset. If you set a variable with the -ffilename
option, you must thereafter include filename in references to that variable. For example, ${(file)VARIABLE}.
FMLI inherits the UNIX environment when invoked.
OPTIONS -l Sets or unsets the specified variable in the local environment. Variables set with -l will not be inherited by processes invoked
from FMLI.
-e Sets the specified variable in the UNIX environment. Variables set with -e will be inherited by any processes started from FMLI.
Note that these variables cannot be unset.
-ffile Sets or unsets the specified variable in the global environment. The argument file is the name, or pathname, of a file containing
lines of the form variable=value. file will be created if it does not already exist. Note that no space intervenes between -f and
file.
EXAMPLES
Example 1 A sample output of set command.
Storing a selection made in a menu:
name=Selection 2
action=`set -l SELECTION=2`close
NOTES
Variables set to be available to the UNIX environment (those set using the -e option) can only be set for the current fmli process and the
processes it calls.
When using the -f option, unless file is unique to the process, other users of FMLI on the same machine will be able to expand these vari-
ables, depending on the read/write permissions on file.
A variable set in one frame may be referenced or unset in any other frame. This includes local variables.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO env(1), sh(1), attributes(5)SunOS 5.11 5 Jul 1990 set(1F)