On Sat, 9 Mar 2024 at 13:19, Bob Proulx <bob@xxxxxxxxxx> wrote: [...] > This issue and the recent non-bsd distro file system locate thrashes > has me now seeing "#!/usr/bin/env sh" which when I saw that the first > time had me cringing but now I am writing that myself to work around > the problem. And then of course I am using only portable shell > features so it does not matter which shell I get from that family. > > As to avoiding the user's login shell [...] You're not completely avoiding it (for example, if it has them, its non-interactive startup scripts will still run) but you are avoiding its command line parsing. > ssh example.com /usr/bin/env sh <<EOF > echo one "t w o" three > EOF > > And then quoting is simplified because stdin only goes through one > layer of shell interpretation. Is there any guarantee that env is at /usr/bin/env? I don't see any mention in https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html I've done a similar thing with the here doc for the same reasons (although I used /bin/sh), but for this example is there any reason you could not omit the env and just do "ssh example.com sh <<EOF ..." ? -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev@xxxxxxxxxxx https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev