1

I usually work on CentOS 7 and a standard(?, /bin/sh automatically installed) shell handles an option set -o posix.

but the option does not work a shell (/bin/sh) in Xubuntu.

It says "no such option: posix", when I try set -o posix.

What is the alternative option in dash?

kensuke1984
  • 949
  • 1
  • 11
  • 21

1 Answers1

2

With Red Hat-based distributions, such as CentOS 7, /bin/sh is a symbolic link to /bin/bash. set -o posix is a shell option that is used by Bash to limit its behaviour so that it’s (more) POSIX compatible.

With Debian-based distributions, such as Xubuntu, /bin/sh is a symbolic link to /bin/dash. As the tag wiki for states, it’s already POSIX compliant. Hence, there’s no need for an explicit option to change its behaviour.

Ardent Coder
  • 3,777
  • 9
  • 27
  • 53
Anthony Geoghegan
  • 11,533
  • 5
  • 49
  • 56