Your quoting is not correct, that ${c} after module will not be evaluated. And, if I infer sort of correctly from what you say, you're trying "dynamic" variables. That does not work that way. As you seem to be using bash, try indirect expansion (see man bash):
i have two lines in my rc.local file that are
wget -O/<path>/<file>.zip url://domain.com
unzip -o /<path>/<file>.zip
the wget works fine, but the unzip won't work. when i copy/pase the unzip line to the prompt it works fine. i thought that maybe the unzip was running before the wget... (0 Replies)
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)
Is it possible with a bash variable to perform multiple substitution strings to one variable?
I have this variable:
echo $clock
TIMEZONE="US/Central"
What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries.
this is... (6 Replies)
When script is running you only see when some of the commands are not successfull.
Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Hello,
can someone please help me to fix this script,
I have a 2 files, one file has hostname information and second file has console information of the hosts in each line, I have written a script which actually reads each line in hostname file and should grep in the console file and paste the... (8 Replies)
Hi
I need help with my coding , first time I'm working with bash .
What i must do is check if there is 3 .txt files if there is not 3 of them i must give an error code , if al three is there i must first arrange them in alphabetical order and then take the last word in al 3 of the .txt files... (1 Reply)
Hi I am trying to do the following in a script find a string and add in a block of text two lines above on the command line this works fine
#/usr/bin/cat /usr/local/etc/dhcpd.conf_subnet | /usr/xpg4/bin/sed -n -e '1h;1\!H;${;g;s/}.*#END of 10.42.33.0/#START of RANGE $dstart\:option... (3 Replies)
I have a script.
filecreatenew () {
touch /usr/src/$1_newfile.txt
var=$1
echo $var
touch /usr/src/$var_newfile_with_var.txt
}
filecreatenew myfile
Its creating file /usr/src/myfile_newfile.txt as the variable $1 is correctly used. When $ is... (2 Replies)
Hi, I am trying to do a bash script that convert a decimal number to a binary value, but it doesn't work...
To begin, I am just trying to convert a positive number to 8 bits binary.
read -p"Entrez un nombre entre -128 et 127 pour l'encoder en binaire: " number
binaryValues=(128 64 32 16 8 4 2... (8 Replies)
Discussion started by: Zedki
8 Replies
LEARN ABOUT OPENSOLARIS
setenv
setenv(3C) Standard C Library Functions setenv(3C)NAME
setenv - add or change environment variable
SYNOPSIS
#include <stdlib.h>
int setenv(const char *envname, const char *envval,
int overwrite);
DESCRIPTION
The setenv() function updates or adds a variable in the environment of the calling process. The envname argument points to a string con-
taining the name of an environment variable to be added or altered. The environment variable is set to the value to which envval points.
The function fails if envname points to a string which contains an '=' character. If the environment variable named by envname already
exists and the value of overwrite is non-zero, the function returns successfully and the environment is updated. If the environment vari-
able named by envname already exists and the value of overwrite is zero, the function returns successfully and the environment remains
unchanged.
If the application modifies environ or the pointers to which it points, the behavior of setenv() is undefined. The setenv() function
updates the list of pointers to which environ points.
The strings described by envname and envval are copied by this function.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned, errno set to indicate the error, and the environment is left
unchanged.
ERRORS
The setenv() function will fail if:
EINVAL The envname argument is a null pointer, points to an empty string, or points to a string containing an '=' character.
ENOMEM Insufficient memory was available to add a variable or its value to the environment.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO getenv(3C), unsetenv(3C), attributes(5), standards(5)SunOS 5.11 31 Mar 2002 setenv(3C)