Hi
how to execute a bash script in csh shell?
Thanks
type :
which bash
at command prompt,
add at the start of shell script the path along with "#!" , in my unix box it is
#!/usr/bin/bash
...
your shell script
...
problem:
A simple script:
#!/bin/bash
echo "Ciao Grande Vito"
echo "$1"
echo "Inserisci un nome"
read nome
echo "$nome"
exit 0
If I execute this script in a bash shell:
./script hallo
it print Hallo and print that I typed.
If I execute thi script in a csh shell:
It print Hallo and
nome: undefined variable
Thanks
Hence , always try to execute using "bash" in another way.
bash script_name.sh