Date: Sun, 22 Sep 2024 13:13:19 +0200 From: tlaro...@kergis.com Message-ID: <zu_7z64hgi7fz...@kergis.com>
| No: just the shell. Putting this in a C source will not be portable, | since the shell used for system(3) would not mandatorily understand | a "set -o xfilename" or whatever the name for the option. No, there would need to be some other mechanism, probably an environment var (like -o posix, and POSIXLY_CORRECT) to enable it in other functions. But if you're not going to be able to have "xargs foo/bar" work, or set EDITOR to foo/bar and have that work, then I don't think any of this belongs inside sh either - everything that you need at sh command level can be provided by functions -- including PATH searches - and just about as fast as the shell would do it, as most of the time there is spent reading directories, and checking for the existence of file names within them (test -x)) which is going to be essentially the same either way. kre