On 14/02/24 at 17:48, Greg Wooledge wrote:
On Wed, Feb 14, 2024 at 05:35:59PM +0100, Franco Martelli wrote:
On 14/02/24 at 17:15, Greg Wooledge wrote:
# env LC_ALL=C script -t 2>~/upgrade-bookwormstep.time -a
~/upgrade-bookwormstep.script
That command is already using Bourne family shell syntax (the 2> part)
so you can drop the env.  It'll fail in csh regardless.  On the other
hand, the env doesn't hurt anything.  It's just extra typing.


Ah! However it's needed for csh users so they are warned, if it's extra
typing it doesn't hurt, thought.

csh cannot redirect stdout and stderr separately.  You can either redirect
stdout only, or redirect them both into the same file.  It has *nothing*
equivalent to >file1 2>file2.

A new question arise spontaneously: how can csh users run a "script" saved session using "scriptreplay" command? In the §4.4.1 "Recording the session" paragraph ¹ I see this syntax:

# scriptreplay ~/upgrade-bookwormstep.time ~/upgrade-bookwormstep.script

That it uses both stderr and stdout saved separately. Maybe they have to use another syntax or forcibly run a Bourne shell as you wrote below:


The usual recommendations for csh users who need to do this are either:

1) Run sh, and then run the command.
2) sh -c 'long command with >file1 2>file2'

Then run env command at the beginning it is useless.

Thanks again

¹ https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#record-session
--
Franco Martelli

Reply via email to