Subject: bug#33824: coreutils v.8.30 – An expression part of a cat command is interpreted as "ambiguous redirect" when applied to a target.

From: Assaf Gordon <[email-masked]>
Date: Sat, 22 Dec 2018 22:58:51 -0700

tags 33824 notabug
close 33824
stop

Hello,

On 2018-12-21 8:32 a.m., Ricky Tigg wrote:
> 
> Command executed:
> $ cat a* >> b*
> bash: b*: ambiguous redirect
> 
> Thought the same syntax is used with success when applied only to source
> files:
> $ cat a* >> b
> $
> 
> Probably a bug. 

This is not a bug - it is the result of the shell (not cat)
performing glob-expansion (i.e. the "b*" string expands multiple
existing files whose name starts with "b").

Consider the following example:

   $ touch b1 b2 b3
   $ echo > b*
   -bash: b*: ambiguous redirect

As such, I'm closing this as "notabug".
Discussion can continue by replying to this thread.

-assaf