![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting environment variable on a remote solaris machine using shell script | eamani_sun | Shell Programming and Scripting | 1 | 05-30-2008 11:05 PM |
| sed on an environment variable ? | lumix | Shell Programming and Scripting | 3 | 12-15-2007 06:30 PM |
| environment variable | sharanbr | Shell Programming and Scripting | 8 | 06-12-2007 09:43 AM |
| problem in getting the path of environment variable set in bashrc in my shell script | krithika | Shell Programming and Scripting | 8 | 05-26-2006 09:19 AM |
| help on environment variable | mehuldoshi | UNIX for Advanced & Expert Users | 6 | 03-29-2003 12:45 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Set the 'DISPLAY' environment variable script
Hello once again
Im trying to set my DISPLAY variable using a script, so i wrote the following: Code:
#!/bin/sh
HOME=10.100.1.100
OFFICE1=10.100.1.101
OFFICE2=10.100.1.102
for TEST in HOME OFFICE1 OFFICE2
do
if [ $1 = $TEST ]
then
export DISPLAY=${$TEST}
break
else
echo "Not Matched"
fi
done
There is obviously something wrong with the way I'm implementing the $($...)) part, except I don't know what. Is there any proper way to do this? Also, if someone has any recommendations on how to implement what I want in a more efficient way, by all means, enlighten me ![]() Thanks! |
|
||||
|
try this
Code:
#!/bin/sh
HOME=10.100.1.100
OFFICE1=10.100.1.101
OFFICE2=10.100.1.102
for TEST in \$HOME \$OFFICE1 \$OFFICE2
do
if [ $1 = $TEST ]
then
export DISPLAY=$(eval echo $TEST)
break
else
echo "Not Matched"
fi
done
|
![]() |
| Bookmarks |
| Tags |
| export display |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|