Changing from one shell to another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Changing from one shell to another
# 1  
Old 09-30-2010
Changing from one shell to another

Hi all,I installed cent OS in my machine. Now when i open the terminal and start writing some commands, then by default with which shell i am working with?

Will i be able to change the shell and then run a few commands? if possible then how to change the shell?

Please reply

Thank you
# 2  
Old 09-30-2010
By typing the corresponding command for Shell,
for ex: for bash it is
#bash and yr shell will be changed.
# 3  
Old 09-30-2010
So you want to say that #csh will change the current shell to c shell,correct?

What is the system command to check in which shell i am working at present?
# 4  
Old 09-30-2010
echo $SHELL
will print current shell.
# 5  
Old 09-30-2010
ok First i did this:

#ksh

then i did this:

echo $SHELL

The output i get is this:

/bin/bash

why not the output is /bin/ksh then?

---------- Post updated at 04:05 AM ---------- Previous update was at 03:57 AM ----------

every time i write this:

echo $SHELL

the output is /bin/bash

after #ksh, if i do this: echo $SHELL

then also the output is /bin/bash

So?????getting confused
# 6  
Old 09-30-2010
Quote:
Originally Posted by gautamshaw
ok First i did this:

#ksh

then i did this:

echo $SHELL

The output i get is this:

/bin/bash

why not the output is /bin/ksh then?

---------- Post updated at 04:05 AM ---------- Previous update was at 03:57 AM ----------

every time i write this:

echo $SHELL

the output is /bin/bash

after #ksh, if i do this: echo $SHELL

then also the output is /bin/bash

So?????getting confused
if you want to change your shell just edit bash to ksh in the /etc/passwd file end of the your username file.for example your username is oracle

Code:
 
vi /etc/passwd
oracle:x:250:302:Oracle User:/export/home/oracle:/bin/bash

change bash with ksh and save the file
# 7  
Old 09-30-2010
1) Don't edit /etc/passwd directly unless you really know what you are doing. If you do have to do it in an emergency, use "vipw" and definitely not "vi".

To change a default shell for a user just use the "usermod" command.

2) If you log in with one shell and want to change to another shell which is installed on your computer, just type the path to that shell:
e.g.
/usr/bin/ksh

(i.e. Don't type a # character).

If the shell does not change it can be because some Linux machines link all likely shell names to "bash".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing value using 1 shell command

Hello all, I would like to know how to change a value in my file.txt with 1 command. Using sed seems impossible since it contains \n and \s... For example: player: version: V6R2013xD3HF5v1 partchecker: version: 6.142.1-rc6 player_old: version: V6R2013xD3HF5v1 ... (6 Replies)
Discussion started by: jcanale
6 Replies

2. Shell Programming and Scripting

Changing shell from a script and running something from the new shell

Hi We use "tcsh" shell . We do the following steps manually: > exec ssh-agent zsh > python "heloo.py" (in the zsh shell) I am trying to do the steps above from a shell script This is what I have so far echo "Executing " exec ssh-agent zsh python "hello.py" exit 0 Problem is... (5 Replies)
Discussion started by: heman82
5 Replies

3. Shell Programming and Scripting

Changing a shell template variable

I'm trying to use a custom command in the configServer loadalert.txt file. the problem is that any command that I place inside the square brackets is simply not working. This is a multi-part message in MIME format. -------------- Content-Type: text/plain; Content-Transfer-Encoding: 7bit ... (2 Replies)
Discussion started by: kshazad
2 Replies

4. Shell Programming and Scripting

changing a shell

i have created users but those are not listing in HOME directory...and i want to change a shell to another shell...can any one reply me with solutions.. (4 Replies)
Discussion started by: potu@123
4 Replies

5. UNIX for Dummies Questions & Answers

changing shell???

hi guys I have a user that has been used for long time now that runs o C Shell... now there is a need to change it to Bash Shell? Can I cause a problem changing his shell from C to bash? I mean apps or variables? thanks a lot (3 Replies)
Discussion started by: karlochacon
3 Replies

6. Shell Programming and Scripting

Changing the shell prompt

Hi, I want to change the shell prompt, using the cd command. I have a shell prompt like this - p78-mfx(dgaw1078/9781)$ Now i do this - p78-mfx(dgaw1078/9781)$ cd log4j here the shell prompt should change like this - p78-mfx(dgaw1078/9781)log4j$ (6 Replies)
Discussion started by: arunkumarmc
6 Replies

7. OS X (Apple)

Changing Default Shell

I bought a used MacBook G4 with Tiger 10.4.11 Running fine, then I noticed a few things were missing. I don't have Terminal or Netinfo Manager in my Utilities! I downloaded iTerm, but for some reason my shell is set to /dev/null I know I can change my shell using Netinfo Manager, but I don't... (5 Replies)
Discussion started by: Ricardo-san
5 Replies

8. Shell Programming and Scripting

changing shell while using ssh

Hello, I am trying to ssh to a remote machine then change the shell and execute the script. However the ssh session hangs when i try to change the shell ssh user@host 'csh ; source /home/cshProfile; $HOME/exec.sh' if i do ssh user@host ' $HOME/exec.sh' This works however i... (2 Replies)
Discussion started by: amit1_x
2 Replies

9. Shell Programming and Scripting

Regarding changing shell thru script

Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine. Or please suggest other alternative if any??? #!/bin/ksh HOST=`hostname` echo "Running the script..." for MyServer in `cat ServerNames.txt` do echo "\n Logging onto... (4 Replies)
Discussion started by: sdosanjh
4 Replies

10. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies
Login or Register to Ask a Question