LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-04-2011, 06:26 AM   #1
casualzone
Member
 
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

vs

#!/bin/bash


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

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
As far as which one to use (which it seems you are confused), that is up to your discretion. Read here - http://www.insectnation.org/howto/bash-vs-tcsh

To understand what a shell is, read here - https://secure.wikimedia.org/wikiped...ki/Linux_Shell

Hope that helps. Cheers,

Josh
 
Old 04-04-2011, 09:44 AM   #3
16pide
Member
 
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, 10:14 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720Reputation: 720
bash and csh are different languages (although designed to solve the same problem) and are not interchangeable.
 
Old 04-04-2011, 10:31 AM   #5
czakrzewski
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, 08:28 PM   #6
casualzone
Member
 
Registered: Jan 2010
Posts: 189

Original Poster
Rep: Reputation: 15
ok.. thx
 
  


Reply


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 08:19 PM
[SOLVED] /usr/bin/xterm: Could not exec /bin/bash: Permission Denied suheng Linux - Newbie 2 09-24-2010 06:31 PM
[SOLVED] #!/bin/sh vs #!/bin/bash -- script executes differently; each way = different bugs GrapefruiTgirl Programming 21 12-16-2009 06:30 PM
How to add paths to sbin, bin/bash, bin sh for users gopi.d Fedora 3 12-07-2007 01:47 AM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 03:30 AM


All times are GMT -5. The time now is 10:02 AM.

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