I am trying to set multiple environment variables using shell script.
I tried below commands to set the environment variables in the shell script(as example i shared one variable info):
when i executed the shell script it's executed successfully but when i am trying to print the environment variable it's returning empty value echo $NAME -- is giving empty value.
Can you please let me know what i need to change to set the environment variable ?.
Moderator's Comments:
please wrap your samples/codes in CODE TAGS as per forums rules.
Last edited by RavinderSingh13; 04-17-2020 at 12:22 AM..
First: me == noob. Whats a good resource for shell script info cause I'm having trouble finding good info.
I'm writing a shell script to automate the setup of a flash 'page flip'.
My current code is below.
the page flip takes an xml file of format
<content>
<pages... (1 Reply)
Hi all!
I know that environment variables can be set on the .bashrc file, but I need to set them from a sh script. I saw a lot of websites that teach this but it doesn't work for me.
#!/bin/sh
DEKTOP=$DESKTOP=:/home/rrodrigues/Desktop
export DESKTOP
if I do echo $DESKTOP returns me... (10 Replies)
oopps! I Meant "Define Variables within a UNIX Script"
What would be the best way to define a variable in a unix shell script so anyone who views this script doesn't know what value is assigned to that variable.
some other location...
a="/usr/lib/fileA"
Unix script...
sed... (5 Replies)
Hello Everyone
I need to create a script file which must append some lines to a target text file, I'm using sed for windows, the script file look like this:
{
a\
STRINGTABLE DISCARDABLE\
BEGIN\
5, 150 {a\
#define RC_SHELL, "%ID_SHELL%"\
#define RC_NAME, "%ID_NAME%"\
END
}
... (1 Reply)
Hi All,
I am using ETL tool Datastage and is installed on Linux environment. Few environment variables are set in datastage. Now my requirement is to use those environment variables in a unix script.
Is there any option I can do it?
Sugeestions from people working on datastage and linux... (1 Reply)
I'm pretty new to scripting in Korn shell so please forgive me...
What I'm trying to do is to create a script that calls multiple other ksh scripts and defines variables for text files.
I need it to define my user defined variables (file paths, date & time stamps, etc that are currently in... (1 Reply)
I have tried with the following:
csh -c 'source ~/.cshrc; exec bash' # works perfectly
(cat ~/.cshrc; echo exec bash) | csh # not working
And, using sed, I successfully retrieved the environment variables from ~/.cshrc
sed -rn 's/setenv\s+(\S+)\s+(.*)$/export \1=\2/p' ~/.cshrc
but now... (6 Replies)
how to store the count of queries in variables inside a filein shell script
my output :
filename
-------
variable1=result from 1st query
variable2=result from 2nd query
.
.
.
. (3 Replies)
Dear Shell script Experts,
I am working on shell script which is defined here, qsub_seq.csh . The purpose of this script is to read few input files (with defined starting index and last index) and make processing faster over server.
For some task, I had 1064 of input files, so I wrote another... (8 Replies)
Discussion started by: emily
8 Replies
LEARN ABOUT CENTOS
pcp.conf
PCP.CONF(5) File Formats Manual PCP.CONF(5)NAME
pcp.conf - the Performance Co-Pilot configuration and environment file
SYNOPSIS
/etc/pcp.conf
DESCRIPTION
When using Performance Co-Pilot (PCP) tools and utilities and when calling PCP library functions, a standard set of environment variables
are defined in /etc/pcp.conf. These variables are generally used to specify the location of various PCP pieces in the file system and may
be loaded into shell scripts by sourcing the /etc/pcp.env(5) shell script and queried by C/C++ programs using the pmGetConfig(3) library
function. If a variable is already defined in the environment, the values in pcp.conf do not override those values, i.e. the values in
pcp.conf serve as installation defaults only.
Both the pcp.env and pcp.conf files are expected to be found in /etc by default. If required, the pcp.conf file may be relocated and
PCP_CONF set in the environment to specify the full path to the new location. The pcp.env file can not be relocated (this is the only hard
coded path required by PCP).
The syntax rules for pcp.conf are as follows :
1. the general syntax is
PCP_VARIABLE_NAME=variable value to end of line
2. lines that begin with # and all blank lines are ignored.
3. all variables must be prefixed with PCP_. This is a security issue - variables that do not have this prefix will be silently ignored.
4. there should be no space between the variable name and the literal = and no space between the = and the variable value (unless the
value actually starts with a space). This is required because the pcp.conf file may be sourced directly by Makefiles as well as inter-
preted by the pcp.env script and the pmGetConfig function.
5. variable values may contain spaces and should not be quoted. The pcp.env script automatically quotes all variable values from the
character immediately following the = through to the end of the line.
For further details and an explanation of the use of each variable, see the comments in the /etc/pcp.conf file itself.
ENVIRONMENT
The PCP_CONF environment variable specifies an alternative path to the pcp.conf file.
SEE ALSO PCPIntro(1), PCPIntro(3), PMAPI(3), pmGetConfig(3) and pcp.env(5).
Performance Co-Pilot PCP PCP.CONF(5)