With #!/bin/bash aka shebang, you declare the script to be bash.
By starting the very same script with tcsh ./script.sh, you overwrite the bash-shebang to be tcsh.
So if the script fails beeing executed by itself, with a bash-shebang, it is not bash.
Changing the shebang to #!/bin/tcsh should do the trick.
This way, if executable flag is set, it can also be executed like:
For most scripts you'll find either none or .sh file extension. .sh in this scenario usualy just means 'shell', and that script should contain a shebang, otherwise it simply assumes to be the same shell as the current environment shell.
Know that many, if not all, distro's have /bin/sh symlinked to their specific default shell.
Which in most cases could be either: bash, dash, ksh or zsh.
So going with #!/bin/sh can result in unexpected behaviour when the script is shared.
Scripts without a shebang, should then have their shell/-name as extension, eg: .bash .dash .tcsh
When sharing, most forums to not support 'variant' file extensions to attach, and limit scripts to ".sh", which therefor requires scripts to have the proper shebang set.
What you need to do?
In an interactive tcsh (shell terminal) find out the PATH to 3dcalc with
Then edit the script and change the 3dcalc to the full pathname.
Im looking for 2 Files -> *.WAV and *.wav with
find . -name 'unavail.wav' -o -name 'unavail.WAV' I need to list the Folders that contains these 2 Files?
Thx in advance (13 Replies)
Hello! I have got a homework. The bash script runs in the background and checks the user's mailbox and when the user gets a new mail a popup window appears with some text and information about the sender (from who and when).I have no idea how to start, any help would be appreciated! Thank you:) (1 Reply)
Hi,
I meet an problem that it cannot change Terminal environment variable in a perl or bash script.
This change can only exist and become effective in script lifetime.
But I want to make this change take effect in current opened Terminal.
In our view, the thought seems to be impossible,
As... (9 Replies)
Hello,Geeks
How i can run my script permanently. once i run my script it should be working always.
like installation.
for example if i run one command once in bash script. it must be permanently run in my linux machine..
Thanks in Advance (2 Replies)
Hi
I have a bash script which takes parameters
sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC
gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash
I have... (0 Replies)
Hello,
I'm trying to make a bash script that send me e-mail if there is any new file in my ftp folder.
cat inotify.sh
#!/bin/sh
/usr/bin/inotifywait -e create \
-mrq /home/mrowcp | while read line; do
echo -n "$line " >> /var/log/inotify.log
echo `date | cut -d " " -f1-4` >>... (3 Replies)
So I have a script that runs as a non-root user, lets say the username is 'xymon' .
This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root.
in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
How can I make a bash script that keeps on running after I have closed the terminal?
Or a script that runs without having the terminal window open? (1 Reply)
Hi.
I don't have any experience with making scripts in bash. I need a simple script to rename all files in a folder to the format file1.avi, file2.avi, file3.avi, and so on.....
Please note that the original files have different filenames and different extensions. But they all need to be... (2 Replies)
How can I get a bash script to wait and read and count $i messages that a running program (drbl clonezilla) sends to the console (terminal) and only then move on to the next line in the script when the count is matched (the next line is the last line of the script and is a reboot)?
The script... (0 Replies)