In XRAT C.1.7 Built-In Utilities[0], it is said that you can implement exec-able builtins with the following shell script:
$0 "$@"This wouldn't actually work: $0 is the absolute path, so the script would recurse indefinitely.
You should use something like ${0##*/} instead of $0. [0] https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap01.html#tag_23_01_07 -- Jakub Wilk