Hacker News new | past | comments | ask | show | jobs | submit login
Help me add FreeBSD/amd64 build support to .NET CoreCLR (github.com/ajensenwaud)
96 points by hestefisk on Feb 11, 2015 | hide | past | favorite | 12 comments



#!/bin/bash isn't a Linuxism. #!/bin/sh and then relying on Bash features is.

#!/bin/bash just means your port has to depend on shells/bash, which is pretty reasonable.


Except by default, bash from the Ports tree gets but into /usr/local/bin/bash. An easy fix for users, but a better hashbang would be #!/usr/bin/env bash


Whoops. You are right. I don't know how to edit my comment...


Assuming `bash` is in `/bin` is definitely a linuxism. It won't be there on BSDs, and even when there's a bash there it may not be up to date (e.g. on OSX where up-to-date software is installed via homebrew or macports and the binaries are not in /bin)


#!/bin/bash and then not using any features not available in sh (or using bash features that could be written trivially in sh) is definitely a linuxism.


Most of the time /bin/sh would suffice as no bash features are used but people still use /bin/bash.


Also don't use absolute paths in your shebang


The executable is passed to execve, so it has to be an absolute path (part of the reason for the indirection via env)


So e.g. in this case it'd be better to use just "#!env bash"?


That doesn’t even work. The interpreter needs to use an absolute path, hence the trick with “env”.


#!/bin/bash is a linuxism. #!/usr/bin/env bash is the portable version.


So much mindless discussion about "Linuxism" and incorrect usage of bash.

So little apparent willingness to help out. Kinda disappointing really.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: