12-10-2007
There's no real difference. The first approach will work even if you have a different shell selected at the top of the script or have not set execute permissions on test.sh.
The second approach will use whatever shell is in the #! path and will only run if the execute bit is set.
Which approach to use depends on your environment and needs.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have a script like:
echo Please input list file name:
read listn
for file in `cat $listn.txt`
do
send_file $file
done
normally, I will run the script like:
:. resendfile
Please input list filename:
list1
#Then, the script will resend all file from the list1. However,... (4 Replies)
Discussion started by: happyv
4 Replies
2. Shell Programming and Scripting
Hi,
How can I run a script at 9:00am and 6:00pm everyday? Can I run it at background while I logout my account?
Please help!!
Many Thanks!! (1 Reply)
Discussion started by: happyv
1 Replies
3. Shell Programming and Scripting
Hello all
i have csh script called test.csh , and i need to run it in the background
so i do : test.csh &
but i wander can i tell within the script source to run it in the background automatically , without giving the user to add the "&"
when executing in the shell ? (1 Reply)
Discussion started by: umen
1 Replies
4. Shell Programming and Scripting
hi,
i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies
5. UNIX for Dummies Questions & Answers
I have a script I want to run in the background, and I have looked it up but I am not exactly sure how to do. First of all to run it in the background do you have to put something in the script or is it just a command when you go to run it. I found this solution to it but once again I am not to... (2 Replies)
Discussion started by: mauler123
2 Replies
6. Shell Programming and Scripting
Dear All,
I am trying to run a script in background like ./scriptname.sh & but when i try to run it in background it is giving me an error "syntax error at line 12: `(' unexpected" at the line 12, there is a function definition
"function getFileList()".
This script runs fine if i run on... (2 Replies)
Discussion started by: bilalghazi
2 Replies
7. Shell Programming and Scripting
hi,
we have a script which runs for the whole day and whenever the job fails, will send an alert to the mailbox. My problem here is that i need to give the jobname dynamically which is not possible if we run the script in background. Pls help me with this.
Thanks
Ajay (6 Replies)
Discussion started by: ajayakunuri
6 Replies
8. Shell Programming and Scripting
Dear All,
Writing a script in which I want to run a command in background and keep it running even script is finished.
I have tried like below,
`truss -p <pid> >> & /tmp/log &`
But doesnt work.. script goes running and nothing in log file. (7 Replies)
Discussion started by: Deei
7 Replies
9. Shell Programming and Scripting
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)
Discussion started by: capo2ndfret
1 Replies
10. UNIX for Beginners Questions & Answers
Hi Guys,
i am having a script which checks for ip address is pingable or not,when i execute this script in terminal it keeps on showing the pinging status of every ip address and it takes more time when i check for 100 ip address,How to do run a script in background without showing in the terminal... (4 Replies)
Discussion started by: Meeran Rizvi
4 Replies
LEARN ABOUT OPENSOLARIS
pipelog.conf
pipelog.conf(4) File Formats pipelog.conf(4)
NAME
pipelog.conf - pipelog configuration for libpipelog.so of the plugins of gnome-system-log file
SYNOPSIS
/usr/lib/gnome-system-log/plugins/pipelog.conf
DESCRIPTION
The libpipelog.so is a plugin for gnome-system-log(1), it runs commands through
pipes and get the output of the individual pipe as a log content. Users can
copy the file into $HOME/.gnome2/gnome-system-log/plugins/`uname -p` to
overwrite the system default one.
The syntax of pipelog.conf file is:
<log path><whitespace><command>
<command> may be a simple program name (which will be found in $PATH) or an absolute path of a binary with arguments list. "%s" can be
included in <command> zero or one time, will be replaced by <log path> in runtime.
FILES
/usr/lib/gnome-system-log/plugins/pipelog.conf
The system default configuration file for the plugin libpipelog.so
$HOME/.gnome2/gnome-system-log/plugins/`uname -p`/pipelog.conf
The user specific configuration file for the plugin libpipelog.so
EMAMPLE
/var/adm/wtmpx last
/var/adm/utmpx /bin/last -f %s
SEE ALSO
gnome-system-log(1), grablogs.conf(4)
gnome-utils 2.16.0 13 Oct 2006 pipelog.conf(4)