The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk -v in SunOS PradeepRed Shell Programming and Scripting 3 08-14-2008 06:20 AM
gdb for SunOS 5.6 shafi2all SUN Solaris 1 05-29-2008 12:39 AM
SunOS 5.4 mr_balodoy SUN Solaris 6 03-30-2008 08:06 PM
Unix Korn Shell Array Issue (SunOS) Janus Shell Programming and Scripting 5 11-21-2006 05:19 PM
Migration of binary file from Sunos 5.8 to Sunos 5.9 Arvind Maurya UNIX for Advanced & Expert Users 1 07-12-2005 03:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-05-2006
Registered User
 

Join Date: Aug 2005
Posts: 111
Question SunOS shell help

I'm new to SunOS and I need some help.

I'm trying to run the commands below inside the korn shell below on SunOS 5.8 but it does not do anything except echo ABC. No error gets displayed when running the shell.

Code:
#!/bin/ksh

echo ABC
export ENV_1=/folder1/subfolder
cd folder2
All 3 commands above work when I run them outside of the shell at the command prompt.

Any help in getting this shell to work will be greatly appreciated.

Steve
Reply With Quote
Forum Sponsor
  #2  
Old 07-05-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,698
Actually you would not see any messages for the export and cd command. If you want the changes to be permanent, then try running the script as
Code:
. youscript.ksh
rather than just
Code:
yourscript.ksh
or
Code:
./yourscript.ksh
To see the actual effect of your script, try this

Code:
#!/bin/ksh

echo ABC
export ENV_1=/folder1/subfolder
echo $ENV_1
cd folder2
pwd
Reply With Quote
  #3  
Old 07-06-2006
Registered User
 

Join Date: Aug 2005
Posts: 111
Vino,

It worked.

Thank you very much for your help!

Cheers
Steve
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0