Running CSh scripts in Bash | Unix Linux Forums | UNIX for Dummies Questions & Answers

  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 Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-28-2010
mjdousti's Avatar
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 08-29-2010
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 25 October 2014, 2:06 AM EDT
Location: Amsterdam
Posts: 9,549
Thanks: 285
Thanked 2,426 Times in 2,174 Posts
try:

Code:
csh /path/to/test.csh

Sponsored Links
    #3  
Old 01-17-2011
mjdousti's Avatar
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 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 01-17-2011
mjdousti's Avatar
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 01-18-2011
cero cero is offline
Registered User
 
Join Date: Aug 2006
Last Activity: 24 October 2014, 10:27 AM EDT
Posts: 378
Thanks: 3
Thanked 69 Times in 63 Posts
Does your csh script start with a shebang?
Sponsored Links
    #7  
Old 01-18-2011
mjdousti's Avatar
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 Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:10 AM.