Date: Mon, 2 Jan 2023 10:02:45 -0500 From: Greg Wooledge <g...@wooledge.org> Message-ID: <y7lyft9rnldui...@wooledge.org>
| Aliases are not used in bash scripts, unless bash is invoked in POSIX | compatibility mode, or the "expand_aliases" shopt is turned on. I think that's what must have happened ... the infinite loop of echo commands suggests that the function definition cmd() { echo "$@" ; } was converted by the alias info echo() { echo "$@" ; } and when you see that, it is obvious why cmd a b c (which becomes echo a b c) just runs echo which runs echo which runs echo which ... Whether POSIXLY_CORRECT is in the environment (that's what I did to get the described behaviour) or for some other reason bash is set up to operate in posix mode, it is fairly clear that is what happened. Yet another reason to never use aliases, for anything, anywhere, they're an abomination, and rarely accomplish what one might expect. kre