Computing.Net > Forums > Linux > Bash to CSH

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Bash to CSH

Reply to Message Icon

Name: akhen
Date: April 19, 2007 at 07:05:01 Pacific
OS: SUSE 10
CPU/Ram: lots
Product: IBM
Comment:

I am using Suse 10, and I am using BASH by default. I like Bash. I have some scripts that are written in CSH, that I didn't write, but need to use. How can I tell bash to start csh to source the files?

I was thinking maybe having bash open another window, starting CSH and then sourcing the files, but once csh starts, it doesn't want to do anything but csh stuff, and not anything that bash passes it.

I've tried putting #!/bin/csh at the beginning of the script thinking that would force it to run in csh, but that didn't work (not sure if that's suppose to work anyway). I tried doing a csh(source .filename), but nope. I tried csh&&source blah...and nothing, I've tried a lot of stuff similar.

I'm looking for an easy way to do this, any help would be great.

technoguy



Sponsored Link
Ads by Google

Response Number 1
Name: ernie
Date: April 19, 2007 at 08:31:54 Pacific
Reply:

I do not use any csh scripts here, so I do not know much about it. I do use Mandriva Linux 2007.1 here and it includes tcsh (a 100% csh compatible command interpreter (shell). From the manual (man), it appears you can execute it from bash with a command line. One possibility would be as follows:

tcsh "myscript -option1 arg1 arg2 arg-n"

Another possibility is to run it interactively:

tcsh -

See man tcsh for better help.

HTH,

Ernie Registered Linux User 247790
ICQ 41060744


0

Response Number 2
Name: akhen
Date: April 19, 2007 at 10:03:49 Pacific
Reply:

Is TCSH compatible with Bash too?

technoguy


0

Response Number 3
Name: nails
Date: April 19, 2007 at 17:34:22 Pacific
Reply:

First, if the shell you want to use is installed and is located in the PATH, then placing the shell invocation on line 1 and position 1 should work.

Are you sure /bin/csh is installed. tcsh is a superset of csh. That should work as well as csh.

You say that it doesn't "work". Exactly what is the error message you are getting?


0

Response Number 4
Name: jefro
Date: April 21, 2007 at 15:01:25 Pacific
Reply:

Seems to me your profile determines the shell enviroment. Change it to what you wish?

I read it wrong and answer it wrong too. So get off my case you goober.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Bash to CSH

How to make Limewire work witn JRE www.computing.net/answers/linux/how-to-make-limewire-work-witn-jre-/13218.html

Command to Scan Bash History www.computing.net/answers/linux/command-to-scan-bash-history/25701.html

Bash www.computing.net/answers/linux/bash/12742.html