This method works perfectly in any shell.
NOTE: $$ holds the process id of current shell.
[penguin@cheetah:/home/penguin]#ps | grep -i `echo $$`
18530 0:00 ksh
[penguin@cheetah:/home/penguin]#bash
bash-3.00$ ps | grep -i `echo $$`
18574 pts/196 0:00 bash
bash-3.00$ csh
cheetah% ps | grep -i `echo $$`
18578 pts/196 0:00 csh
cheetah% tcsh
> ps | grep -i `echo $$`
18590 0:00 tcsh
To find the current shell and display the shell name alone:
ReplyDelete[penguin@cheetah:/home/penguin]# ps | grep `echo $$` | awk '{print $NF}'
ksh
This comment has been removed by the author.
ReplyDeletehttp://2.bp.blogspot.com/-xh3sW85RWS4/UJCVGRQ7zzI/AAAAAAAAOKQ/ltY9quzfpZY/s1600/10.jpg
ReplyDeleteThis is the information that I was looking for. Thanks for the efforts you put to gather such a nice content and posted here.
ReplyDeleteOracle Fusion HCM Training Institutes in Hyderabad
ReplyDeleteNetworking Projects for Final Year CSE Students
The IEEE Network projects Networking Projects for Final Year CSE Students has direct impact on undergraduate and graduate student education and training. Final Year Engineering Students who are software developers can structure a project around building a network firewall application Final Year Project Centers in Chennai
JavaScript Training in Chennai
JavaScript Training in Chennai