Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: very weird echo problem



Uli Zappe wrote:
>    log_function()
>    {
>       DATE=$(date)
>       echo $MESSAGE
>       echo $MESSAGE >> $LOGFILE
>    }
> 
>    log_function TEST1; log_function TEST2
>    log_function TEST3; log_function TEST4
> 
> B. If I execute the script NOT FROM A TERMINAL (but e.g. cron), then
>    the script will stop after the first LINE with log_function calls
>    (NOT the first log_function!), i.e. it will print
>       TEST1
>       TEST2
>    to the logfile and then STOP EXECUTION of any code following

Hmm, you can't be telling us everything since TEST1 and TEST2 are
passed as positional parameters, which don't get used by log_function.
How does $MESSAGE get set?  Can you produce an actual minimal script
which shows this?

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



Messages sorted by: Reverse Date, Date, Thread, Author