Skip to content

Is the default shell to run %post section sh or bash on Ubuntu 22.04? #2528

Closed Answered by dtrudg
Heng-Zhou asked this question in Q&A
Discussion options

You must be logged in to vote

/bin/sh is called by default. On many distributions this is a symlink to bash. However, on Ubuntu it is dash, which is a POSIX sh shell.

Generally, it is safest to write %post etc. assuming they will run on a POSIX sh compatible shell. If you need to use non-sh syntax, specify a custom shell with -c as documented - https://docs.sylabs.io/guides/latest/user-guide/definition_files.html#post

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Heng-Zhou
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants