Differences between linux and Solaris /usr/bin/env
I’ve a simple script:
#!/usr/bin/env perl -w
print "Hello Worldn"
Make this executable, run on Linux, and I get:
/usr/bin/env: perl -w: No such file or directory
(without the -w, this works OK)
Running the same script on a Solaris 8 machine produces the correct output.
Any suggestions as to why this is ?
It’s not env; it’s the kernel’s #! handler. Everything after the first word (/usr/bin/env) is passed as a single argument string. Safest/most portable is to not put anything after the perl there.
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





