in reply to Re^2: CR/LF in bin
in thread CR/LF in bin

Interesting but doesn't seem to work on my ubuntu:

$ echo -e '#!/usr/bin/env -S perl\r\nprint "Foo!\\n";' > foo.pl
$ chmod 755 foo.pl
$ ./foo.pl
/usr/bin/env: ‘perl\r’: No such file or directory

Replies are listed 'Best First'.
Re^4: CR/LF in bin
by hippo (Archbishop) on May 09, 2024 at 22:19 UTC

    Which version of env are you running? I have:

    env (GNU coreutils) 9.5 Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/g +pl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Richard Mlynarik, David MacKenzie, and Assaf Gordon.

    🦛

      env (GNU coreutils) 8.32

        That's from 14 years ago. Perhaps it's time to consider upgrading? :-)

        Update: Sorry, that should be 4 years ago so not that ancient after all (thanks, choroba). I can't find that particular version but do have 8.30 and confirm that it fails in the same way as 8.32.


        🦛