[Novalug] bash scripting

Angelo Bertolli angelo@freeshell.org
Sat Jun 2 03:48:44 EDT 2007


Miguel Gonzalez Castaños wrote:
> Hi,
>
> I want to launch a command using nohup in a bash script, and when the 
> command has finished send an email with the log file. I prefer not to 
> have to type nohup script.sh & and be able to wait inside my script.sh :
>
>  nohup command > log &
>
>  mail -s "subject" email@address < log
>
>  I have googled but I can't figure it out
Maybe I don't understand what you're asking, but won't your command 
return immediately because you're backgrounding that process?  Then the 
mail will happen immediately every time.

Anyway, if you really hate having to type nohup script.sh & every time, 
then just make an alias ;)


-- 
http://heroesonly.com/ | http://bitfreedom.com/




More information about the Novalug mailing list