Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-25-2003, 10:01 PM   #1
Registered: Jul 2003
Distribution: redhat 8.0, 9.0, FC3
Posts: 32

Rep: Reputation: 15
'bash'ing vars (dumping same)

Can you echo all the variables that are not exported with a single command in bash?
Old 07-26-2003, 11:06 AM   #2
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 110Reputation: 110
Good question!
The best I can think of is:

(env | sed 's/^\([^=]*\)=.*/\1/' ; compgen -v) | sort | uniq -u

However, this does not echo the values of the var's though, it only lists their names.

"compgen -v" lists the names of all var's, the rest of the commandline above serves to get rid of the exported ones.

Last edited by Hko; 07-26-2003 at 11:22 AM.


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
SUSE Environment Vars apocolpse SUSE / openSUSE 6 11-18-2010 04:04 PM
Novell is dumping KDE, so I'll be dumping SuSE KimVette SUSE / openSUSE 10 11-12-2005 09:09 PM
passing vars to awk schneidz Programming 6 09-25-2005 02:52 PM
env vars on Slackware 10 lvella Linux - General 1 11-01-2004 05:55 PM
Environment vars AMDPwred Linux - General 2 02-28-2003 08:11 AM

All times are GMT -5. The time now is 10:37 PM.

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