Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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

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?

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.

![]() |
![]() |
![]() |

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