Groups | Search | Server Info | Login | Register


Groups > alt.os.linux.mint > #47333

Re: echo does not display from bash script

From Mark Bourne <nntp.mbourne@spamgourmet.com>
Newsgroups alt.os.linux.mint
Subject Re: echo does not display from bash script
Date 2026-05-03 13:00 +0100
Organization A noiseless patient Spider
Message-ID <10t7ddk$2segc$1@dont-email.me> (permalink)
References <20260502201304.8dd1eeb5073cc5422b0fdc8a@gmail.com> <10t5v4u$2gf4u$1@dont-email.me>

Show all headers | View raw


Paul wrote:
> Let us work with this one.
> 
>     somecommand >> "$LOGFILE" 2>&1
> 
> That says to redirect "stderr" to "stdout",
> then redirect "stdout" additively to the $LOGFILE.
> Nowhere does it mention anything about also
> including a copy on Alans Screen :-)
> 
> How about if we try this ?
> 
>     somecommand 2>&1 | tee >> "$LOGFILE"

I think you need:

     somecommand 2>&1 | tee --append "$LOGFILE"

Otherwise you're redirecting the copy that tee sends to stdout to the 
file instead (so you still won't get any output on the terminal), and 
not giving tee any files to copy it to.

--
Mark.

Back to alt.os.linux.mint | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

echo does not display from bash script pinnerite <pinnerite@gmail.com> - 2026-05-02 20:13 +0100
  Re: echo does not display from bash script "Alan K." <alan@invalid.com> - 2026-05-02 18:21 -0400
    Re: echo does not display from bash script "Alan K." <alan@invalid.com> - 2026-05-02 18:24 -0400
  Re: echo does not display from bash script Paul <nospam@needed.invalid> - 2026-05-02 18:51 -0400
    Re: echo does not display from bash script Mark Bourne <nntp.mbourne@spamgourmet.com> - 2026-05-03 13:00 +0100
      Re: echo does not display from bash script pinnerite <pinnerite@gmail.com> - 2026-05-05 21:39 +0100
  Re: echo does not display from bash script Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-05-02 23:00 +0000

csiph-web