Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-04-2011, 05:26 AM   #1
Registered: Jan 2010
Posts: 189

Rep: Reputation: 15
/bin/bash vs /bin/csh

i try to run a script to do automation

what is the difference for the header (1st line) for

#! /bin/csh -f



as i know one is bash shell while the other is c shell
can i swap it ??
Old 04-04-2011, 06:44 AM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005Reputation: 1005
As far as which one to use (which it seems you are confused), that is up to your discretion. Read here -

To understand what a shell is, read here -

Hope that helps. Cheers,

Old 04-04-2011, 08:44 AM   #3
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
I'll just add that bash and csh script language are different languages. So if a script was written using the bash language, do not try to interpret it using csh, and vice-versa.
Bottom line, is you definitely do not want to change that #! line at the top of the script.

If you're missing the bash or csh interpreter on your system, then that's what you should focus on.
Depending on which brand of Linux you run, the way to install it will be slightly different. Let us know.
Old 04-04-2011, 09:14 AM   #4
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
bash and csh are different languages (although designed to solve the same problem) and are not interchangeable.
Old 04-04-2011, 09:31 AM   #5
LQ Newbie
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
bsh and csh not interchangeable

some commands in the bash shell are new..hence the "bourne again shell".
Old 04-04-2011, 07:28 PM   #6
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
ok.. thx


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to configure /bin/csh, /bin/sh Ribo01 Linux - Newbie 7 03-21-2011 07:19 PM
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 05:31 PM
[SOLVED] #!/bin/sh vs #!/bin/bash -- script executes differently; each way = different bugs GrapefruiTgirl Programming 21 12-16-2009 05:30 PM
How to add paths to sbin, bin/bash, bin sh for users gopi.d Fedora 3 12-07-2007 12:47 AM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration