how to add a path variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to add a path variable
# 1  
Old 06-14-2012
how to add a path variable

Hi,

I tried to add a path vairable
export GPLOAD_CONNECT_STR= -U crm -h sdc-gp1-dev1 -d wmgpdev

but it throws the below error
Code:
-bash: export: `-U': not a valid identifier
-bash: export: `-h': not a valid identifier
-bash: export: `sdc-gp1-dev1': not a valid identifier
-bash: export: `-d': not a valid identifier

Anyone please help to fix this error

thanks in advance,
Burton

Last edited by Franklin52; 06-15-2012 at 04:33 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 06-14-2012
Put it in quotes like any other string.

Code:
export GPLOAD_CONNECT_STR="-U crm -h sdc-gp1-dev1 -d wmgpdev"

This User Gave Thanks to Corona688 For This Post:
# 3  
Old 06-14-2012
Thanks Corona688, it works Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

add path variable permanently

Hi, I have added the path variable as below export... (4 Replies)
Discussion started by: burton
4 Replies

2. UNIX for Dummies Questions & Answers

how to make my own $PATH variable

hi all, i have to implement a mini-SHELL for a project in C++ i used "system()" to call bash functions found in $PATH i want to change this variable to $MYPATH, so, when i execute a coommand, the program will look for it in $MYPATH, not in $PATH how can i do it? Double post (0 Replies)
Discussion started by: bismillah
0 Replies

3. Shell Programming and Scripting

Path a variable to sed that includes a path

Hi I'm trying to select text between two lines, I'm using sed to to this, but I need to pass variables to it. For example start="BEGIN /home/mavkoup/data" end="END" sed -n -e '/${start}/,/${end}/g' doesn't work. I've tried double quotes as well. I think there's a problem with the / in the... (4 Replies)
Discussion started by: mavkoup
4 Replies

4. Shell Programming and Scripting

Appending a path in user's PATH variable

Hello Folks, I want to append a path in user's PATH variable which should be available in current session. Background Numerous persons will run a utility. Aim is to add the absolute path of the utility the first time it runs so that next runs have the PATH in env & users can directly run... (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

5. Shell Programming and Scripting

one liner to extract path from PATH variable

Hi, Could anyone help me in writing a single line code by either using (sed, awk, perl or whatever) to extract a specific path from the PATH environment variable? for eg: suppose the PATH is being set as follows PATH=/usr/bin/:/usr/local/bin:/bin:/usr/sbin:/usr/bin/java:/usr/bin/perl3.4 ... (2 Replies)
Discussion started by: royalibrahim
2 Replies

6. Shell Programming and Scripting

remove a path from PATH environment variable

Hi I need a script which will remove a path from PATH environment variable. For example $echo PATH /usr/local/bin:/usr/bin:test/rmve:/usr/games $echo rmv test/rmve Here I need a shell script which will remove rmv path (test/rmve) from PATH... (9 Replies)
Discussion started by: madhu84
9 Replies

7. Shell Programming and Scripting

Sed variable substitution when variable constructed of a directory path

Hello, i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem. my var1 is a string constructed like this: filename1 filerev1 filepath1 my var2 is another string constructed like this: filename2 filerev2 filepath2 when i do... (2 Replies)
Discussion started by: alrinno
2 Replies

8. Shell Programming and Scripting

Getting the path from a variable

Hi, I am having a variable Like line="/dir1/dir2/gr3/file.ksh" I need to get the /dir1/dir2/gr3 alone. the no of directories may differ at each time. Please advice. thanks in advance. (3 Replies)
Discussion started by: vanathi
3 Replies

9. Shell Programming and Scripting

add bin to variable PATH and save changes

i wrote a script and is running. I add the path bin to variable PATH, i.e. PATH=$PATH/bin. i add this to PATH in order to run the script in any path working directory. Thats ok. The problem is as son as i close the session and start a new session, changes are lost. How can i tell the shell or... (1 Reply)
Discussion started by: alexcol
1 Replies

10. UNIX for Dummies Questions & Answers

How to add a variable to the "path"

Hello, I am new to this board and I have several questions: For two days now I've been trying to add a variable to my "path" -- without any success. What I want to do is add the path for my MySQL database to my "path" so I can access it from anywhere. Why is this such a hard thing to do in... (7 Replies)
Discussion started by: PixelLover
7 Replies
Login or Register to Ask a Question