notary icon indicating copy to clipboard operation
notary copied to clipboard

Adding `/usr/bin/env bash`

Open truongnh1992 opened this issue 6 years ago • 5 comments

This commit aims to add /usr/bin/env bash as a shebang line to indicates scripts use bash shell for interpreting.

Signed-off-by: Nguyen Hai Truong [email protected]

truongnh1992 avatar Feb 20 '19 08:02 truongnh1992

Can one of the admins verify this patch?

docker-jenkins avatar Feb 20 '19 08:02 docker-jenkins

I would rather we could just use /bin/sh to be honest. Is there anything non Posix in those files?

justincormack avatar Feb 20 '19 11:02 justincormack

I would rather we could just use /bin/sh to be honest. Is there anything non Posix in those files?

It uses bash instead of sh shell.

truongnh1992 avatar Feb 20 '19 15:02 truongnh1992

I know it uses bash now, but does it need to? Does it use any bash-only features?

justincormack avatar Feb 20 '19 16:02 justincormack

/usr/bin/env sh or /usr/bin/env bash is the recommended best practice when writing bash scripts.

https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my

If we don't use bash specific functions sh is preferred as well. Imagine developers having zsh and no bash. Then it still works without installing bash.

marcofranssen avatar Jan 10 '20 08:01 marcofranssen