LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-25-2003, 09:01 PM   #1
3inone
Member
 
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, 10:06 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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 10:22 AM.
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:47 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration