in reply to Re^5: shebang anomaly
in thread shebang anomaly
I appreciate your insights but you're missing the point. I don't intend to reinvent the wheel and write a new shell. What I need and what I want is to execute Perl scripts with the same shebang in either macOS or Linux, or even Windows XP with the help of MKS Toolkit. Why, because I have multiple Perls installed in each OS and multiple OSes and all share the same Perl source. So, I don't want to have to edit scripts originating in macOS with a #! /usr/bin/env perl -w shebang to #! /usr/bin/perl -w just so they run in debian. perlbrew does this now with nothing more than a fairly sophisticated .bashrc. The cmd code I downloaded that choroba pointed me to does almost what I want now. It only omits actually printing the environment but that is trivial to fix. Whenever this cmd/env is called without any arguments it can print the environment, the %ENV hash. So, you seem to be hinting that Linux is less capable than macOS (just another *NIX), and/or the maintainers of GNU coreutils are incapable of doing or unwilling to do what Apple engineers did and can do? Why do you think this works in macOS and not Linux, other than the maintainers of env don't want to do it? Are fork and exec in Darwin different from their counterparts in Linux? Or BSD, or AIX, or Next, or any other UNIX or UNIX-like OS?