user3853033
user3853033

Reputation: 55

How can I make a hybrid bash/tcsh script on Linux?

I have one script which runs in Bash and and other which runs in tcsh.

I need to run them both from the same script. How can I create a script that can run both bash and tcsh commands?

Upvotes: 1

Views: 308

Answers (1)

Vality
Vality

Reputation: 6607

Most shells have an argument which allow you to pass them a string to run as a command, for example, for bash you can run

bash -c "echo this is a bash script; echo lalalala"

to run that string as a script in bash, use this to run the needed shell embedded in the other. This will allow you to make a script in one shell which will invoke the other shell when the other program needs to be run.

If on the other hand they are both properly shebanged begin with #!tcsh or #!bash you can simply run both scripts from the same bash script using:

/path/to/script1 &
/path/to/script2 &

Upvotes: 1

Related Questions