Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Gabor Heppes — — source: Informix-list mailing list archive (1991-1998)
Hi All,
I am trying to prevent ontape's "Please mount ..." messages piling up in
the log file. I also want to catch the exit status of ontape. I have
tried to use the suggested solution to pipe the output through 'head',
as follows (I'm using ksh) :
echo '\\n\\n' | ontape ... | head -100 > mylog 2>&1
While this does kill ontape after 100 lines, the exit status of the
pipeline is that of head, which is 0.
My next iteration:
{
echo '\\n\\n' | ontape ...
echo $? > ontape_stat_file # can't use var, this is a sub-shell
} | head -100 > mylog
wait
read stat < ontape_stat_file
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.