Date:Mon, 2 Jan 2023 10:02:45 -0500
From:Greg Wooledge
Message-ID:
| 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 l
On Mon, Jan 02, 2023 at 10:13:28AM +0200, Yuri Kanivetsky wrote:
> Hi,
>
> #!/usr/bin/env bash
> set -eu
> alias cmd=echo
Aliases are not used in bash scripts, unless bash is invoked in POSIX
compatibility mode, or the "expand_aliases" shopt is turned on.
Hi,
#!/usr/bin/env bash
set -eu
alias cmd=echo
cmd() {
echo "$@"
}
set -x
cmd a b c
$ ./a.sh
+ echo a b c
+ echo a b c
...
+ echo a b c
+ echo a b c
Command terminated
Sounds like a bug. I'd expect it to notice the alias, turn "cmd a b c"
into "echo a b c" and print the letters.
Regards,
Y