Linux - EnterpriseThis forum is for all items relating to using Linux in the Enterprise.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
I recently installed Enterprise, version 2.6.9-5.EL, and have some old software that I need to run for work, but bash doesn't seem to like it. I installed it from a script that was designed to get it working under .cshrc or .tcshrc by writing a source script into them and the .login file. I figured it was just a case of adding this script to the .bashrc file, but it doesn't seem to like it. The programs are installed, and some of them work if I type the explicit file path, but some don't, I think because the .cshrc script should set them up when it runs, but isn't doing it from .bashrc.
When I log in or source the link manually I get the following error message;
bash: /star/etc/cshrc: line 694: syntax error: unexpected end of file
The software is the Starlink Astronomy package, and can be found at ftp.starlink.rl.ac.uk/pub/ussc/cdrom/current/
Unfortunately the Starlink organisation ceased to exist in 2004, and there have been no updates since then.
ETA Sorry, my bad, I just assumed that a forum called Linux - Enterprise would be about the Enterprise version of Linux. Could a mod please move this to the Software forum? Cheers.
If your software is working with the C shell configuration and not with your Bash configuration, it is likely that you only need to establish some environment variables. There are different syntaxes for this is the two shells.
Check your csh configuration and all files 'source'd and include any variables set therein in you .bashrc (or create another file which defines them and source that from your .bashrc).
Sourcing from bash is: . <file-path>
Yes that is a dot.
If your software is working with the C shell configuration and not with your Bash configuration, it is likely that you only need to establish some environment variables. There are different syntaxes for this is the two shells.
Check your csh configuration and all files 'source'd and include any variables set therein in you .bashrc (or create another file which defines them and source that from your .bashrc).
Sourcing from bash is: . <file-path>
Yes that is a dot.
Hope this helps.
sorry for choosing as test of the first.
i have tried all ways to delete this noob reply,all failed however.
Last edited by lcn; 12-15-2006 at 03:24 AM.
Reason: sorry...not able to delete it --_-
The fundamental problem is that you're dealing with two families of shell syntax: the Bourne family, and the csh family. Your .bashrc uses (duh) bash, which is in the Bourne family, and your problem script is (obviously) in the csh family.
You have two possible ways of fixing this. I'll describe the simpler way first.
The first way is to use csh to execute the problem script.
Enter the following at the command prompt:
which csh
If you get something back like
/bin/csh
then you're in luck. Go to the problem script and add a new line at the top. For this to work, it must be the first line of the script. The new line should look like this (but adjust it appropriately if your output from the "which" command was slightly different):
#!/bin/csh
Your script should now work. But make sure that if you've made any prior changes to it trying to get it to work, undo those changes! For example, if you've changed any statements from setenv to export (as advised by hmc in a different reply to your question), then you need to change those back.
But if you get something like this:
which: no csh in (/usr/local/bin:/usr/bin:/bin)
then you probably don't have csh on your system. In that case, try this whole first way over again, using tcsh instead of csh; tcsh is another shell in the csh syntax family.
If that doesn't work either, then you need to use the second way. This will be a little more work. It will involve converting your script so that it uses the Bourne syntax, so bash can handle it.
To do that, go to google (I hope that works in China), and search for this:
Bourne csh differences
You'll get several reference works that will help you out. Pick the one that works best for you. Don't forget to remove the "#!/bin/csh".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.