[Discuss] Bash question

Noel Burton-Krahn noel at burton-krahn.com
Sat Aug 16 23:36:32 PDT 2014


Hi John,

I use 'tail -f' to save the output of a program and watch it at the same
time:

make >make.out 2>&1 & tail -F make.log


Note, Ctrl-C will kill tail, not the make session above.  You have to kill
make explicitly if you want to stop it:

kill %-



Sometimes you make want to start a long running program and be able to log
in from time to time to see how it's doing.  I start it in a screen session:

screen -d -m -S myscreen tcpdump  -veplni host


Then later while it's running I can log in from a different session and
check up on it

screen -dr myscreen

Or kill it:

screen -X -S myscreen quit


HTH
--
Noel


On Fri, Aug 15, 2014 at 3:24 PM, John Blomfield <jabfield at shaw.ca> wrote:

> Here is a snippet from a bash script cron job I run:
>
> .............
> if rsync -avz --delete --exclude=lost+found $SOURCEDIR $DESTDIR 1>
> $DEBUGLOG 2> $ERRORLOG; then \
> ..........
>
> Occasionally, I need to run this script manually in a terminal and would
> like to see the output in the terminal as well as saving it to the debug
> and error log files. Any suggestions?
>
> --
> John Blomfield
> Delivered by Thunderbird Email on Linux OpenSuse-KDE4
>
> Old John B's Linux Notes http://www.oldjohnbslinux.wordpress.com
>
>
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://lists.vlug.org/mailman/listinfo/discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://vlug.org/pipermail/discuss_vlug.org/attachments/20140816/e5c66b95/attachment.html>


More information about the Discuss mailing list