Re: Does "LC_ALL=C" work on all shells?
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.
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'
Reply to: