echo $SHELL, $PWD and etc.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers echo $SHELL, $PWD and etc.
# 1  
Old 12-15-2002
echo $SHELL, $PWD and etc.

hi, this echo $SHELL will give the shell name.. how to get the other list of variables (besides SHELL) values?

and also, different shells have different variable names (example SHELL)
yls177
# 2  
Old 12-16-2002
I'm not really sure what you exactly mean, but if you're using bash (i don't know about the other shells), try to type

set

should give you a list of environment variables defined and their corresponding values.
# 3  
Old 12-16-2002
brilliant.. thanks!!!

now,ksh, csh, sh all can uses SET....

ksh -> kourne
chs -> c shell
sh -> bourne

am i right?
yls177
# 4  
Old 12-16-2002
Quote:
Originally posted by yls177

ksh -> kourne
I think it's spelt "korn". Smilie
Others are correct.
# 5  
Old 12-17-2002
It might be useful to compare the output of set with the output of env

Are they different? If so, why?
# 6  
Old 12-17-2002
I feel both ( set & env ) give more or less the same output.
Perhaps set gives a more detailed information.
minazk
# 7  
Old 12-17-2002
On my system, set gives more entries than env.

But I don't really know why this is so. Although every time I just pick one arbitrarily, I seem to use set more often than env as that's what was taught when I learned bash.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to change shell's pwd

Hi there, i was presented with a challenge that is beyond my current shell knowledge: how can you have a script that executed interactive will change your current working directory? Example (under MacOS): 1. start Terminal and my current working directory is my home folder 2. execute a... (3 Replies)
Discussion started by: gigagigosu
3 Replies

2. AIX

sync samba pwd with aix5.3 pwd

currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work. aix5.3 and samba 3.0.24.0 thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies

3. Shell Programming and Scripting

shell echo help needed

echo '#!/usr/local/bin/expect' > sree_expt echo "spawn passwd $User" >> sree_expt echo 'expect "New password:"' >> sree_expt echo send "$Password\r" >> sree_expt echo 'expect "Re-enter new password:"' >> sree_expt echo send "$Password\r" >> sree_expt echo "expect eof" >> sree_expt for... (0 Replies)
Discussion started by: sreedhargouda
0 Replies

4. Homework & Coursework Questions

implementing mkdir, chdir, mv, pwd inside a shell !

1. The problem statement, all variables and given/known data: need to implement mkdir, chdir, mv, pwd given a shell.cpp directory.cpp and some other files this shell missing these commands, and i need to implement them inside the shell 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: evantheking
0 Replies

5. Shell Programming and Scripting

echo $PWD doesn't work

I have entry in the my .profile like below, but still i see $PWD is not defied in my system export PS1=$LOGNAME@`hostname`':'$PWD'>' echo $PWD also gives me nothing, my env list also give no entry for PWD.Can someone help me setting PWD variable. I use /bin/sh (9 Replies)
Discussion started by: yesmani
9 Replies

6. Solaris

Confused with echo $SHELL Command....

Hi.. Everyone... Kindly consider following : login as: root Using keyboard-interactive authentication. Password: Last login: Mon Nov 3 19:30:50 2008 from xxxxxxxxxxx Sun Microsystems Inc. SunOS 5.10 Generic January 2005 You have new mail. Sourcing //.profile-EIS..... # # ... (3 Replies)
Discussion started by: Reboot
3 Replies

7. UNIX for Advanced & Expert Users

echo ${PWD#${PWD%/*/*}/}

Can anyone explain this in detail ... echo ${PWD#${PWD%/*/*}/} Thanks in Advance (1 Reply)
Discussion started by: sakthi.abdullah
1 Replies

8. Shell Programming and Scripting

pwd & cd commands not working in shell script

Here is my script #!/bin/bash pwd cd /var/lib/pgsql Both "pwd" and "cd" are not executed is there any other way i can change the current working directory to /var/lib/pgsql pls help! (9 Replies)
Discussion started by: perk_bud
9 Replies

9. Shell Programming and Scripting

Shell and echo

Probably my first post, very new to shell scripting :) Here is the script i am trying to modify to use function # Script to create simple menus and take action according to that selected # menu item # while : do clear echo "-------------------------------------" echo "... (2 Replies)
Discussion started by: replyramdas
2 Replies

10. UNIX for Advanced & Expert Users

Echo with ksh shell

Hi All, I'm trying to use the "echo" command in a korn shell script, and I want it to drop the trailing newline. Now I know that with the bash shell, the "-n" flag would solve this issue. Does anyone know how this can be done with the korn shell? Cheers Khoom (10 Replies)
Discussion started by: Khoomfire
10 Replies
Login or Register to Ask a Question