On Mon, Apr 15, 2019 at 05:10:14PM +1000, Cameron Simpson wrote:
> On 15Apr2019 08:34, felixs <besteck...@gmail.com> wrote:
> > On Mon, Apr 15, 2019 at 07:33:53AM +1000, Cameron Simpson wrote:
> > > On 15Apr2019 07:19, Cameron Simpson <c...@cskk.id.au> wrote:
> > > > Think about it. You're invoking sed _once_. Its input can come from only
> > > > one file.
> > > 
> > > Actually, I lie. The way you're doing it "sed <filename" can only use one
> > > file. Sed will work on many files, like almost any UNIX utility:
> > > 
> > >  sed .... /path/to/spooldir/*
> > 
> > I can confirm that without redirecting standard input and just putting
> > the path as last argument works.
> > And I can also confirm that with the redirection from standard input,
> > the mentioned error message is still output.
> > By the way, the error message (when redirecting) is in German (my locale),
> > (I re-translated it into English) even when I put LC_ALL=C before the
> > command. But that only happens here, with THIS precise sed command.
> 
> It may depend on what's making the error message.
> 
> Your redirection message from:
> 
>  < /path/*
> 
> comes from bash. If you went like this:
> 
>  LC_ALL=C sed .... </path/*
> 
> then the LC_ALL=C is associated with the sed command only, which has not
> been issued. So your bash message will be in the German locale.
> 
> On the other hand, this:
> 
>  LC_ALL=C sed 'illegal sed command' ...
> 
> invokes sed in the C locale and then sed will issue errors on that basis.
> 
> Does this distinction fit with the behaviour you see?
> 
Yes, I can confirm that. If I put
LC_ALL=C sed <invalid-command> outputs a sed error, in C.
Typing in LC_ALL=C bash -----v ouputs bash error message in C.
The redirection error in itself remains a mystery for me.

Cheers,
felixs


Reply via email to