LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-02-2012, 04:09 PM   #16
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814

export passes variables to subprocesses, but that doesn't help getting the data back to the parent:
Code:
$ export x=fish
$ echo $x
fish
$ whoami | while :;do x=chips;break;done
$ echo $x
fish
The problem is explained in detail here: I set variables in a loop that's in a pipeline. Why do they disappear after the loop terminates? Or, why can't I pipe data to read?

Last edited by ntubski; 03-02-2012 at 04:10 PM. Reason: used [quote] instead of [code]
 
  


Reply

Tags
bash, loop, management, package, variable


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define global variable maxmil Linux - Newbie 4 03-07-2006 10:36 AM
How can I define a global variable? kloss Linux - General 4 02-21-2006 04:30 AM
diff between #define and const defined variable b123coder Programming 7 06-27-2005 08:02 AM
how am i define an environment variable? yenonn Slackware 2 12-19-2003 07:44 AM
how to define a global variable Anniebaby Programming 1 11-09-2003 10:43 PM


All times are GMT -5. The time now is 04:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration