On Mon, Jun 24, 2024 at 09:37:42PM +0300, Oğuz wrote:
> You can do these
>
> $ %f(){ :;}
> $ declare -f %f
> %f ()
> {
> :
> }
> $ unset -f %f
> $ declare -f %f
> $ echo $?
> 1
>
> but not call them
>
> $ %f
> bash: fg: %f: no such job
> $ '%f'
> bash: fg: %f: no such job
> $ \%f
> bash: fg: %f: no such job
>
> Why is that? Would it be a bad idea to let such functions take
> precedence over jobspecs?
>
> Oğuz
>
There are actually ways to call them:
$ %f(){ echo hi;}
$ compgen -F %f
bash: compgen: warning: -F option may not work as you expect
hi
😎
o/
emanuele6