The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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 date d3ck_tm High Level Programming 6 11-08-2006 06:33 AM
Solaris 8 setting up a remote printer queue miredale UNIX for Advanced & Expert Users 0 09-12-2006 02:41 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 08:19 AM
Retreiving environment variable from remote system bschnair UNIX for Dummies Questions & Answers 0 04-04-2006 03:03 PM
Accessing remote machine via an enviroment variable ElCaito UNIX for Dummies Questions & Answers 4 02-14-2006 09:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-30-2008
eamani_sun eamani_sun is offline
Registered User
  
 

Join Date: May 2008
Posts: 40
Setting environment variable on a remote solaris machine using shell script

Hi,

I am trying to set environment variable on a remote machine. I want to do it by running a shell script

Here's what I am doin

rsh <remote-hostname> -l root "cd /opt/newclient; . ./setp.sh"

In setp.sh, I have

#############################
cd ../newlib;
export LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/java/jre/lib/i386/client:`pwd`
cd ../newclient

#############################

Output I am getting is


sh: LD_LIBRARY_PATH=::/usr/lib:/usr/java/jre/lib/i386/client:/opt/newlib: is not an identifier

Script is fine when I ran on a remote machine.

. ./setp.sh

Can someone what's wrong with it?

Thanks,
Sundeep

Last edited by eamani_sun; 05-30-2008 at 05:19 PM..
  #2 (permalink)  
Old 05-30-2008
mschwage mschwage is offline
Registered User
  
 

Join Date: Jul 2005
Location: Oak Park, IL
Posts: 102
Yes, I know exactly what's wrong. When you're logged in, you're not using the bourne shell. You're using either bash or ksh. When you run the rsh command, the bourne shell is being used.

Your code needs to look like this:
Code:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/java/jre/lib/i386/client:`pwd`
export LD_LIBRARY_PATH
That will, by the way, work equally well in bash, sh, or ksh.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0