bug-bash
[Top][All Lists]
Advanced

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

Re: Segmentation Fault in bash --posix


From: Martin Schulte
Subject: Re: Segmentation Fault in bash --posix
Date: Fri, 20 Jan 2023 23:50:52 +0100

Hello Nicolas!

>     bash-5.1$ echo () { echo test }
>     > echo test
>     > }
>     bash-5.1$ echo

You have defined a function echo that
- calls itself with the first argument 'test' and the second argument '}' (!!!)
- calls itself with the first and only argument test

Try

type -a echo

and

Echo() {
  echo test }
  Echo test
}
Echo

to get an insight was is happening.

So, it's no surprise that bash finally crashes.

Most probably you want to insert a ; before the first closing }:

echo() { echo test ; }

But even now bash will crash.

Best regards

Martin



reply via email to

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