Quick question: calling c-shell script from bash


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Quick question: calling c-shell script from bash
# 1  
Old 01-11-2011
Quick question: calling c-shell script from bash

Hello,

I have a quick reference question:

I have a very long, but fairly straigtforward script written in c-shell. I was wondering if it is possible to call this script from bash (for ex. having a function in bash script which calls the c-shell script when necessary), and if so, are there any things I need to modify in either script to make it compatible, or simply referring to path/location of c-shell script would be sufficient?

Thanks in advance for your input!
# 2  
Old 01-11-2011
If you have
Code:
#!/bin/csh

at the top of your C-Shell script, you can run it in the same way you would run any other program.

i.e. in your bash script, call it like:
Code:
#!/bin/bash

myfunction() {
  /path/to/myCshellScript
}

...

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Calling bash script from CGI

Hi, I am having two individual scripts Script 1): CGI script - is a simple script which trigger bash script Script 2): Bash script - is a script which execute which collects file system utilization information from all the Unix servers If I am executing CGI script manually from command... (2 Replies)
Discussion started by: Naveen.6025
2 Replies

2. Shell Programming and Scripting

Calling msys shell from bash script

Hi all, I am struck at a very tricky problem. Writing a bash script that calls msys.bat which inherently launches sh.exe. Now from my bash script, I call msys.bat and it creates a shell within. The problem is: I cannot pass any commands to this new shell from my bash script. I need to be able to... (5 Replies)
Discussion started by: sweetu1995
5 Replies

3. Shell Programming and Scripting

Bash shell script undefined array item value question

Hello, I'm new here. I test these expressions's value in my script : (in centOS 6 ) #!/bin/bash array='something' echo "############" echo ${array} echo ${array} echo ${array} echo "############" The output result is : ################# something something #################... (5 Replies)
Discussion started by: lingjing
5 Replies

4. Solaris

bash shell send script question

Hi Experts, Need your help. I am trying to send a command via ssh to about a hundred network devices. I intend to do this via a bash script something similar to the below: ssh -l user testmachine.com "show version" Obviously this will not work given the password prompt that comes... (2 Replies)
Discussion started by: marcusbrutus
2 Replies

5. Shell Programming and Scripting

Quick Bash question.

Hi, I'm basically looking to see what this line of code does: . `dirname $0`/../config/config Thanks. (1 Reply)
Discussion started by: cabaiste
1 Replies

6. Shell Programming and Scripting

Quick bash question

I need to speed up this process. I would like for this script to spawn a sub-process for each line it reads and move on to the next without waiting for the data to be returned. I know with a large list this can be dangerous and eat system resources. However I use this script only when I get a... (7 Replies)
Discussion started by: Garlandxj08
7 Replies

7. Shell Programming and Scripting

Quick Question on sed command in shell script

Hello, I have the following line in one of my shell scripts. It works fine when the search string($SERACH_STR) exists in the logfile($ALERTLOG) but if the search string does not exist this line errors out at run time. Is there a way to make this line return 0 if it is not able to find the... (4 Replies)
Discussion started by: luft
4 Replies

8. Shell Programming and Scripting

one question for bash shell script

Just one question for bash shell script. In bash script, you can use *.txt to call any files in current folder that ends with .txt, like rm *.txt will remove all txt file in current folder. My question is can you actually remember or use the file name among *.txt, I know file=*.txt will not... (9 Replies)
Discussion started by: zx1106
9 Replies

9. Shell Programming and Scripting

quick newbie bash question

I'm in .profile. I want to export a directory ( export MY_TOOL_HOME=/tools/my tool". Unfortunately for me, the directory I want to export to has a space in its name. So when I try to cd $MY_TOOL_HOME, i get a No such file or directory at the command line... thanks for the help (4 Replies)
Discussion started by: redsand9009
4 Replies

10. Shell Programming and Scripting

BASH shell script question

I want to make shell script that takes a list of host names on my network as command line arguments and displays whether the hosts are up or down, using the ping command to display the status of a host and a for loop to process all the host names. Im new to shell scripting so Im not quite sure... (3 Replies)
Discussion started by: ewarmour
3 Replies
Login or Register to Ask a Question