help-bash
[Top][All Lists]
Advanced

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

Re: is it normal that $BASH_COMMAND doesnt contain func() definition cmd


From: alex xmb ratchev
Subject: Re: is it normal that $BASH_COMMAND doesnt contain func() definition cmds ? then its just ( again ? ) the last cmd before foo() def
Date: Fri, 30 Jun 2023 03:49:46 +0200

On Fri, Jun 30, 2023, 03:23 Kerin Millar <kfm@plushkava.net> wrote:

> On Fri, 30 Jun 2023 01:34:43 +0200
> alex xmb ratchev <fxmbsw7@gmail.com> wrote:
>
> > im working on a multiline prompt
> > i use $BASH_COMMAND there
> >
> > the line before the numbers and PWD is bash_cmd
> >
> > foo() : and complete foo() dont appear
> > i just wanna say thats a buggy loss
> >
> > type foo
> > bash: type: foo: not found
> >
> > type foo
> > 1 10216 10216 10216 /data/data/com.termux/files/home
> > foo() :
> > bash: syntax error near unexpected token `:'
>
> Given that the input could not be parsed, it's unreasonable to expect it
> to qualify as a "command currently being executed or about to be executed".
> It is neither of those things.
>

i would have guessed it is like cmdhist , ..

>
> > type foo
> > 2 10216 10216 10216 /data/data/com.termux/files/home
> > foo() { : ; }
>
> Apparently, a function declaration doesn't count as a command. If you
> actually proceed to call the function, the : command will be saved to
> BASH_COMMAND because it's the last simple command to be executed within
> your { list; }.
>

first sentense yea , no func() ever appears
second , yea , if i ran ' foo ' ( which i did now ) it shows :
my issue is , no foo() def printed ..
its just a logical error to me .. missing .. functionality .. somewhere ..

> --
> Kerin Millar
>

axr =p

>


reply via email to

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