Re: function names starting with %

2024-07-01 Thread Chet Ramey
On 6/24/24 2:37 PM, 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? Think of it as a built-in al

Re: function names starting with %

2024-06-25 Thread Oğuz
On Tue, Jun 25, 2024 at 3:32 PM Emanuele Torre wrote: > 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 Neat

Re: function names starting with %

2024-06-25 Thread Emanuele Torre
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:

Re: function names starting with %

2024-06-25 Thread Zachary Santer
On Mon, Jun 24, 2024 at 2:37 PM Oğuz wrote: > $ %f > bash: fg: %f: no such job > $ '%f' > bash: fg: %f: no such job > $ \%f > bash: fg: %f: no such job Set +m won't fix this either. $ %f(){ :;} $ %f -bash: fg: %f: no such job $ set +m $ %f -bash: fg: no job control Unlike ! in an arithmetic con