Re: [SLE] bash script
- From: François Pinard <pinard@xxxxxxxxxxxxxxxx>
- Date: Tue, 21 Mar 2006 19:26:40 -0500
[James D. Parra]
#!/bin/bash
cd /opt/location
exec filename
Thank you for all of your responses. They all worked perfectly.
Two little comments.
First, "cd /opt/location && exec filename" is a bit better, so if the directory does not exist, the command will not be executed. Only a good habit to take: and this one saved my life a few times! :-)
Second, someone said that "exec" was not needed. This is true. Yet, it is a tiny bit faster to use "exec", because the called program will then _replace_ the shell, and when the program will terminate, that will be the end of the story. Otherwise, without the "exec", when the program will terminate, the shell will have to regain control for nothing else than terminating itself. Nowadays, such optimisations are anachronic!
--
François Pinard http://pinard.progiciels-bpi.ca
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx
- References:
- RE: [SLE] bash script
- From: James D. Parra
- RE: [SLE] bash script
- Prev by Date: Re: [SLE] Replacement for backticks -- was: save a file with date and time in it
- Next by Date: Re: [SLE] Wow, wtf is with all the spam?
- Previous by thread: RE: [SLE] bash script
- Next by thread: RE: [SLE] bash script
- Index(es):
Relevant Pages
|