[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59819: Bug Report: [coreutils] echo command interprets wildcards, wh

From: Andreas Schwab
Subject: bug#59819: Bug Report: [coreutils] echo command interprets wildcards, when read with the 'cat' command from a file, in a for-in loop
Date: Sun, 04 Dec 2022 18:55:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Dez 04 2022, th3_d0ctor wrote:

> $ echo "*" >b; for i in `cat b`; do echo "$i"; done
> ==> list current working directory instead of printing the wildcard '*'

That's how it is supposed to work, since file name expansion is
performed after all other expansions (just before quote removal).

This is basic shell operation knowledge that everyone using the shell
should remember.

Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]