-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
As discussed on gitter by @floam, @krader1961 and me:
We should either improve process expansion so that it is usable, or remove it ("juice it or lose it").
Improving it would entail:
-
Add some way to silence the error when no matching process is found (maybe the same as with globs - only allow with
for,setandcount) -
Add some way to use it as part of a word (this would be a big incompatible change)
Removing it would remove a bunch of code. Note that there is also "job expansion", which isn't quite the same thing. E.g. %1 expands not to a process with "1" in its name, but the job with id 1. If that is to be removed as well, this would free up "%" as a special character.
Because of the annoying error, process expansion remains basically unused in fish scripts with one exception: %self. This should be replaced with a variable (see #1202).
In case we consider the POSIX standard way to get a PID from a part of a process COMM to be too odious (as far as I can tell it requires scraping ps output), it would be possible to provide a pidof command instead.
Now fight discuss.