bug-bash
[Top][All Lists]
Advanced

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

function def crash


From: Phi Debian
Subject: function def crash
Date: Thu, 24 Jun 2021 09:48:59 +0200

Hi All,

Dunno if this is a bug or pilot error, I bumped into this.


$ type echo
echo is a shell builtin

$ function echo { \echo the function version; \echo "$@"; }

After this I got different behavior on 'same' OS version, same BASH
version, meaning my environment must interact but can't tell to what extend
at the moment.

On 2 systems I got bash 'crash', probaly in recursion runaway, during the
function definition.
On 1 system the definition is OK, then the run for the function crash,
again on what's look a recursion run away.

I tried this tiny test case on debian 4.19.98-1 (2020-01-26) (little old)
and GNU bash, version 5.0.3(1)-release (i686-pc-linux-gnu) (little old too)
and I got the definition crash behavior.

I bumped into this as I tried to implement something that would tell me all
the 'command' definition of a word0 of a shell command, so having the same
identifier for a program basename, an alias and a function, I wanted to
make something (a function?) that would tell me

$ word0 echo
echo is an alias
echo is a function
echo is a program (a.out...)


I choosed randomly 'echo' as a test case, I could have used ls, etc....
only echo seems to choke.

Cheers,
Phi


reply via email to

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