Oh, okay. Now everything is much clearer.
Seeing this, I can understand, for example, why if I run this twice, the
first time I get the output of the 'id' command and the second time the
output of the 'pwd' command.
alias id=pwd;id # id output.
alias id=pwd;id # pwd output.
Thank you again fo
On 6/18/25 4:05 PM, Alberto Millán wrote:
First of all, I'd like to thank you for your responses.
Okay, now I understand a little better what's going on with recursion.
In most cases, I can now see what's wrong, but there's one specific case
where I can't quite figure out what's wrong.
bash
u first define func
then u use aliases
On Wed, Jun 18, 2025, 10:05 PM Alberto Millán wrote:
> First of all, I'd like to thank you for your responses.
>
> Okay, now I understand a little better what's going on with recursion.
>
> In most cases, I can now see what's wrong, but there's one specific
First of all, I'd like to thank you for your responses.
Okay, now I understand a little better what's going on with recursion.
In most cases, I can now see what's wrong, but there's one specific case
where I can't quite figure out what's wrong.
bash -ic $'alias x=:\nx(){ id;};x' # This case cra
try x() first
then alias
On Wed, Jun 18, 2025, 7:30 PM Stan Marsh wrote:
> This is a "Doctor, it hurts when I do this" type thing.
>
> The short answer is that alias substitution occurs very early, so when you
> type:
>
> alias x='this and that'
> x() { ... }
>
> you are for all practica
On 6/18/25 11:38 AM, Alberto Millán wrote:
Bash Version: 5.2
Patch Level: 37
Release Status: release
Description:
When I define an alias and a function with the same name, I experience
abnormal behavior.
It seems to be especially dangerous when using a colon.
I think there is a misu
On Wed, Jun 18, 2025 at 9:31 AM Alberto Millán wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2
> uname output: Linux ALBERTO 6.6.87.2-microsoft-standard-WSL2 #1 SMP
> PREEMPT_DYNAMIC Thu Ju
This is a "Doctor, it hurts when I do this" type thing.
The short answer is that alias substitution occurs very early, so when you type:
alias x='this and that'
x() { ... }
you are for all practical purposes, typing:
'this and that'() { ... }
At which point, anything can happen. I
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Linux ALBERTO 6.6.87.2-microsoft-standard-WSL2 #1 SMP
PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x8