Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do you know what your current shell is? Post 37172 by Mr_Proper on Friday 13th of June 2003 02:01:29 PM
Old 06-13-2003
Bourne-type shells (that includes bash and ksh) have a $ in front of them. The C shell uses a %, and I think tcsh uses a >.

If you're a super-user or root, you're going to have a hash mark (#) in front no matter what.

You can grep the /etc/passwd file with your username to find out what shell starts up on default (it's the last field), but I'm not sure if there is a command or variable that tells the active shell.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

current shell

how to use the variable in the current process. thought i say export, i willl not be available in the current shell. so how to run the shell in such a way that varible is available (3 Replies)
Discussion started by: mkan
3 Replies

2. UNIX for Dummies Questions & Answers

Command to findout the current shell?

Hi, Can you please tell me if there is anyway we can findout which shell we are using (is there any command?) Many thanks, (5 Replies)
Discussion started by: Aceform
5 Replies

3. Shell Programming and Scripting

How do i execute script in the current shell

How do i run a shell script or perl script with in the context of a current shell. I know that i can use command source. but we can't pass any arguments to our script if we use source command as it takes only one argement i.e filename Is there any way to run a script in the current shell... (5 Replies)
Discussion started by: Naresh Kumar
5 Replies

4. Shell Programming and Scripting

current running process in shell

hi what is the shell programming code to know the number of processes currently running on the machine & information about those processes. Another one is the configuration and usage of the UNIX file system? requesting all for help. thanks (1 Reply)
Discussion started by: moco
1 Replies

5. Shell Programming and Scripting

how do i get current bandwidth usage via shell script?

hello unix-people. can u please tell me how i can get the current bandwidth usage of my machine on shell into variables? thanks a lot (2 Replies)
Discussion started by: scarfake
2 Replies

6. Shell Programming and Scripting

How to run a new shell with copy of current shell declarations?

How to run another shell and have all current shell dectaration copied to that new shell? I would like to have available all current declarations in a new shell. That are functions, aliases, variables. I need to test some functions that use the 'exit', but running it in current shell on... (9 Replies)
Discussion started by: alex_5161
9 Replies

7. UNIX for Dummies Questions & Answers

How do I know my current shell

when I get from my shell into other shell, what is the best way to identify the current new shell in a script ? for example: logged on with bash, and typed csh. I got out the following option: ps -ef | awk -v PID=$$ '{ if ( $2 == PID ) { gsub ("-","") ; print $NF}}' any other idea ? (3 Replies)
Discussion started by: ynixon
3 Replies

8. Shell Programming and Scripting

current line number in shell script

Hi I am using korn shell is there a built in or ny other way to get the current line number so i can write the current line number to the logfile to aid in debugging like logmsg $lineno $date logmsg is a helper function that helps in logging messages to a log file regards (3 Replies)
Discussion started by: xiamin
3 Replies

9. Shell Programming and Scripting

Current instance of Shell ignoring SIGTERM

Hello. Could anyone tell me how can I configure a instance of Shell to ignore the SIGTERM signal? I would really appreciate. Thanks. (6 Replies)
Discussion started by: razolo13
6 Replies

10. Shell Programming and Scripting

Execute C program in Current shell

Hello, I have a c program executable which I need to run inside a shell script. But the c program runs in a subshell because of which all the actions done by the c program is not available to the current shell. Is there any way to execute a C program binary executable in the current shell? (4 Replies)
Discussion started by: sachinverma
4 Replies
CHSH(1)                                                            User Commands                                                           CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy