Unix/Linux Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Running CSh scripts in Bash

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-28-2010
mjdousti's Unix or Linux Image
mjdousti mjdousti is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 28 November 2012, 2:32 AM EST
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Running CSh scripts in Bash

Hi,

I have some csh scripts and I want to run them in .bashrc. I use these techniques without any success:

. test.csh
or
csh test.csh


The first one assumed that the scripts is a bash script, so showed me errors. The second one finished without giving proper result.

Can anybody offer a solution?

P.S.: I use SunOS 5.10 and GNU bash 3.00.16. My default shell is of course Bash.


Thanks in advance.
Sponsored Links
    #2  
Old Unix and Linux 08-29-2010
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 28 May 2015, 1:03 AM EDT
Location: Amsterdam
Posts: 10,216
Thanks: 334
Thanked 2,696 Times in 2,412 Posts
try:

Code:
csh /path/to/test.csh

Sponsored Links
    #3  
Old Unix and Linux 01-17-2011
mjdousti's Unix or Linux Image
mjdousti mjdousti is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 28 November 2012, 2:32 AM EST
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your suggestion. But it doesn't work.
    #4  
Old Unix and Linux 01-17-2011
hongwei hongwei is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 9 January 2012, 12:48 AM EST
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
What errors did you get when you were tring to run csh test.csh? Are you sure all of the things like syntax are correctly used in that script?
Sponsored Links
    #5  
Old Unix and Linux 01-17-2011
mjdousti's Unix or Linux Image
mjdousti mjdousti is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 28 November 2012, 2:32 AM EST
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
I got no errors.
If I change my current shell to CShell or TCShell, it would work properly. Since these scripts modify the local variables such as PATH, this effect will not appear in Bash, and this is my problem.
Sponsored Links
    #6  
Old Unix and Linux 01-18-2011
cero cero is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 27 May 2015, 9:55 AM EDT
Posts: 406
Thanks: 4
Thanked 81 Times in 73 Posts
Does your csh script start with a shebang?
Sponsored Links
    #7  
Old Unix and Linux 01-18-2011
mjdousti's Unix or Linux Image
mjdousti mjdousti is offline
Registered User
 
Join Date: Jan 2007
Last Activity: 28 November 2012, 2:32 AM EST
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Yes! They have #!/bin/csh
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Changing the Bash Scripts to Bourne Scripts:URGENT pgarg1989 Shell Programming and Scripting 3 08-30-2009 10:35 AM
Running scripts within scripts from cron sirbrian Shell Programming and Scripting 4 07-14-2009 10:04 AM
Running scripts via su ravi.sri24 Shell Programming and Scripting 8 02-11-2009 11:28 AM
Running scripts in parallel nivas Shell Programming and Scripting 6 02-21-2008 04:44 AM
running multiple scripts nvuradi Shell Programming and Scripting 3 08-13-2007 09:53 AM



All times are GMT -4. The time now is 02:01 AM.