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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Accessing variables of one shell script in another shell script rsendhilmani Shell Programming and Scripting 2 03-17-2009 01:17 AM
Accessing PL/SQL OUT variables in Korn Shell Script bright_future UNIX for Advanced & Expert Users 4 12-02-2008 12:02 PM
Accessing variables of one shell script in another shell script looza Shell Programming and Scripting 2 06-30-2008 08:13 PM
Accessing Shell Variables in awk or sed nasersh Shell Programming and Scripting 3 05-05-2008 08:44 AM
accessing ksh variables from awk trupti wagh Shell Programming and Scripting 1 02-26-2007 04:11 AM

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

Join Date: Jul 2008
Posts: 3
Problem in accessing variables outside shell

Hi,
I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB session.
I could launch the GDB session after doing the file operation but i am unable to access the exported variables. Is there any way to access the variables outside the shell?

Thanks in advance
Santosh
  #2 (permalink)  
Old 07-18-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Wink One 'trick' I have used is..

I write the variables to a temp file. Then, my other scripts and programs can simply read the test file to determine any variables.

If you write to a temp file similar to the folowing file my_var.tmp

Code:
client, Smith Marketing
year, 2007
taxable, yes

Then you could in other scripts do a:

Code:
client=$(cat my_var.tmp | grep "^client" | cut -d"," -f2)

Although not perfect, it does allow another way to share variables.
  #3 (permalink)  
Old 07-18-2008
jsantosh jsantosh is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 3
I need to use the variables in the GDB session spawned by the shell. In GDB i cant do cat operation.I am looking for a mechanism to access those variables straightway .
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 04:50 PM.


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