I need to create a shell script that will execute node, perl, php, and python servers. How can I execute the various languages within bash?
1 Answer
You just run the appropriate interpreter.
#!/bin/bash
python script1.py
perl script2.pl
# etc
2 Comments
Pazuzu
Thanks for the quick response. Will try it out.
Gordon Davisson
Or add the appropriate shebangs to the python and perl scripts (e.g.
#!/usr/bin/python), make them executable (chmod +x /path/to/script1.py), and then run them with either /path/to/script1.py or ./script1.py. Note that the ./ version only works if it's in the script's current working directory (which is not generally the same as the directory the script is in).