How do I find out what shell I am using?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How do I find out what shell I am using?
# 1  
Old 01-15-2007
How do I find out what shell I am using?

Any ideas?
# 2  
Old 01-15-2007
Try:
Code:
echo $0

# 3  
Old 01-15-2007
Thanks a lot!
# 4  
Old 01-16-2007
$ csh
% echo $0
No file for $0

This is more portable:

% ps -p $$
PID TTY TIME CMD
5494 pts/1 0:00 csh


Regards
Dimitre
This User Gave Thanks to radoulov For This Post:
# 5  
Old 01-17-2007
echo $SHELL
# 6  
Old 01-17-2007
Quote:
Originally Posted by sysgate
echo $SHELL
If you change your shell that wont be reflected in SHELL variable
# 7  
Old 01-17-2007
Something Adhoc! Smilie Smilie

These interpretors will definitely cry out aloud when we do something wrong.

So do that,

Make them shout Smilie

Code:
>0-0
zsh: command not found: 0-0

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find and touch in Shell

Hello All Below is code snippet i am using find . -name "*.txt" -mtime +5 -exec -touch "*.txt" {} + The purpose is to make the files with name *.txt to be of size 0 kb if it is older than 5 days.With above code i am unable to do so.I know alternative is to use if/else loop but i would like... (3 Replies)
Discussion started by: vinil
3 Replies

2. Shell Programming and Scripting

find command in shell script

Hi all, Please i need an explanation for the following statements ref_file=/tmp/cleanfiles export ref_file touch `TZ=WAT+2 date "+%Y%m%d%H%M"` $ref_file find . ! -name . -prune -type f ! -newer $ref_file -exec store_file.sh {} \; (1 Reply)
Discussion started by: anish_1982
1 Replies

3. Shell Programming and Scripting

How to find out the shell of the shell script?

Hello My question is: How to find out the shell of the shell script which we are running? I am writing a script, say f1.sh, as below: #!/bin/ksh echo "Sample script" From the first line, we can say this script will run in ksh. But, how can we prove it? Can we print anything inside... (6 Replies)
Discussion started by: guruprasadpr
6 Replies

4. UNIX for Dummies Questions & Answers

Shell script 'find' command

I have a script that has the following command: find /home/user -name test.dat The script works as desired when running normally. However, when I run the script preceding it with 'sh', it fails. Is there something I need to account for when preceding the execution of the script with 'sh'? (1 Reply)
Discussion started by: bsavitch
1 Replies

5. UNIX for Advanced & Expert Users

shell redirection in find

hi, i need to clear data off a DOA backup drive. i try this, but just get a file {} in . and no change on the backup drive. bash shell find /mnt/usbbackup -xdev -type f -exec echo `date` > {} \; any ideas? thanks. :) (1 Reply)
Discussion started by: drewnichols
1 Replies

6. Shell Programming and Scripting

c shell script help with find

Okie here is my problem, 1. I have a directory with a ton of files. 2. I want to first get an input on how many days ago the files were created. 3. I will take those files and put it into another file 4. Then I will take the last # from each line and subtract by 1 then diff the line from the... (1 Reply)
Discussion started by: bigboizvince
1 Replies

7. UNIX for Advanced & Expert Users

find command from a shell script

Hi experts, I have a shell script (korn shell on aix) where I am giving find command with file options which are read from a configuration file. For some reason I am getting an error find: 0652-017. I have put set -x in the shell script and the command looks okay. If I cut it and paste it in the... (6 Replies)
Discussion started by: kodermanna
6 Replies

8. Shell Programming and Scripting

how to find in which shell i am working..

Hi Friends, I am new for this site.i have a small query.plz let me know the command to find in which shell presently i am working. (2 Replies)
Discussion started by: pineapple
2 Replies

9. UNIX for Advanced & Expert Users

Problem with find command in C-shell

when i use the following command find / -name '*.*' -exec grep -il 'text' {} \; I can redirect the errors to /dev/null. This happens only in ksh but not in csh. the 2>/dev/null is not working in csh. Can you some one suggest an alternative for this in csh ? (3 Replies)
Discussion started by: dhanamurthy
3 Replies

10. UNIX for Dummies Questions & Answers

Where can I find the best Unix Shell?

I am new and I would like to know your opinion on the best Unix shell for linux? :confused: (4 Replies)
Discussion started by: faron17
4 Replies
Login or Register to Ask a Question