This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[OT] #!/usr/bin/env bash -vx



This is not exclusive to cygwin, but maybe someone here can help me. I put

#!/usr/bin/env bash

in the first line on some scripts I use on Cygwin, Linux and HP-UX because
the exact path to bash differs (someone posted this trick on the list
sometime ago). But when arguments are added to the line, like

#!/usr/bin/env bash -vx

this doesn't work anymore - I get:

$ cat qwe
#!/usr/bin/env bash -vx

echo qqqqqqqqqqqqqqqqqqqqqqqqqqqq

$ ls -l qwe
-rwxr-xr-x   1 ljupco   None           59 Jan 31 16:06 qwe

$ qwe
/usr/bin/env: bash -vx: No such file or directory

Wheras the direct path works:

$ cat qwe
#!/usr/bin/bash -vx

echo qqqqqqqqqqqqqqqqqqqqqqqqqqqq

$ ./qwe
#!/usr/bin/bash -vx

echo qqqqqqqqqqqqqqqqqqqqqqqqqqqq
+ echo qqqqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqqqq

thanks,

-- 
Ljubomir Josifovski
mailto:L.Josifovski@dcs.shef.ac.uk,blj01z@motorola.com
http://www.dcs.shef.ac.uk/~ljupco

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]