Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-15-2010, 09:19 AM   #1
LQ Newbie
Registered: Aug 2010
Posts: 17

Rep: Reputation: 1
bash set

hi all,

I've read that the set command can be used to list environment variables in bash. However, when I type set I get what looks like code from some kind of shell script:

return $?;
return 127;
dequote ()
eval echo "$1" 2> /dev/null
quote ()
echo \'${1//\'/\'\\\'\'}\'
quote_readline ()
if [ -n "$bash4" ]; then
echo "${1}";
local t="${1//\\/\\\\}";
echo \'${t//\'/\'\\\'\'}\'

Any idea why this would not list the environment variables? I am running Ubuntu 10.04.
Old 08-15-2010, 09:33 AM   #2
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Perhaps `set` is aliased to something else?

try the `alias` command in your shell and see..

Meanwhile, you could use the `env` command to see environment variables.

NOTE: These are general ideas - if Ubuntu does something strange that I don't know about, well.. I don't know about it
Old 08-15-2010, 10:17 AM   #3
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Normal behaviour. "set" prints all shell variables, including functions (with their implementation details). Try set | less and you will see that it does contain what your were looking for.

If you need something more specific , try:
set +o
set -o
shopt -s
shopt -u
declare -r
declare -a
declare -f
declare -i
declare -x
1 members found this post helpful.
Old 08-15-2010, 09:10 PM   #4
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 247

Rep: Reputation: 31
echo $SET ?


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
Tab width in Bash - how do I set it benr77 Linux - General 8 12-04-2012 11:53 AM
bash script : another set of eyes, please? brumster Programming 13 01-29-2009 07:27 PM
set and export using bash script acummings Linux - General 10 01-03-2005 03:22 PM
how do i set global prefs for bash polonius19 Slackware 2 03-06-2003 06:23 PM
Cant set color or promt in bash outsider Linux - General 2 10-15-2001 01:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 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