The reason I stumbled upon this issue in the first place is perhaps it might be related to this awk script not behaving as expected :- BEGIN { "set -x ; echo ~'/path/to/file'" | getline output1 "set -x ; echo ~''" | getline output2 "set -x ; echo ~\"/path/to/file\"" | getline output3 print output1 print output2 print output3 } Running this script :- ❯ gawk -f script.awk + echo '~/path/to/file' + echo '~' + echo '~/path/to/file' ~/path/to/file ~ ~/path/to/file You can follow the discussion on the script here if you wish to : https://lists.gnu.org/archive/html/help-gawk/2024-10/index.html |