Did you try either of your proposed solutions?
$ cd /tmp/perlmonks/ $ echo -e '#!/usr/bin/env perl \r\nprint "Foo!\\n";' > foo.pl $ chmod 0755 foo.pl $ ./foo.pl /usr/bin/env: ‘perl \r’: No such file or directory /usr/bin/env: use -[v]S to pass options in shebang lines $ echo -e '#!/usr/bin/env perl -w\r\nprint "Foo!\\n";' > foo.pl $ ./foo.pl /usr/bin/env: ‘perl -w\r’: No such file or directory /usr/bin/env: use -[v]S to pass options in shebang lines $
The correct solution is use -S on the env command:
$ echo -e '#!/usr/bin/env -S perl\r\nprint "Foo!\\n";' > foo.pl $ ./foo.pl Foo! $
🦛
In reply to Re^2: CR/LF in bin
by hippo
in thread CR/LF in bin
by dk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |