Bash & Ksh | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Bash & Ksh

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-24-2009
talashil talashil is offline
Registered User
 
Join Date: Apr 2008
Last Activity: 14 July 2014, 1:32 PM EDT
Posts: 137
Thanks: 4
Thanked 0 Times in 0 Posts
Bash & Ksh

I am using a Linux machine and it's default shell is BASH . I have korn shell script and inside it's setting environment variables. But after execuitng the script those env values are not holding the values . If I run the script outside of that ksh script with source a.sh , it's able to hold to values .

what I am trying to do is ...inside the ksh

I tried to like this ..

source a.sh

and if I run it in debug mode , it's still showing it's executing it as
. a.sh ( default korn shell behaviour) .


any ideas how to do this ?

Thanks
Sponsored Links
    #2  
Old 08-24-2009
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is online now Forum Advisor  
Disorganised User
 
Join Date: Nov 2007
Last Activity: 27 November 2014, 9:21 PM EST
Location: New Zealand
Posts: 1,044
Thanks: 21
Thanked 26 Times in 25 Posts
A script isn't going to modify the environment of the parent process - that would make no sense... Is that what you are trying to do?

If so, you need to call it without forking (ie via the . a.sh like you have above).
You can certainly do this inside a script without problems - it's a very common way of putting configuration items used by several scripts in a central file.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
bash preferred or ksh with bash features mrwatkin UNIX for Dummies Questions & Answers 2 06-17-2009 02:19 PM
how to make your bash script run on a machine with csh and bash npatwardhan Shell Programming and Scripting 3 11-19-2008 04:17 AM
bash and ksh: variable lost in loop in bash? estienne Shell Programming and Scripting 2 08-25-2008 03:09 PM
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 01:25 PM
Why generate "ash and bash" different output for same bash script? s. murat Shell Programming and Scripting 0 05-26-2008 08:19 AM



All times are GMT -4. The time now is 10:49 PM.