Ubuntu 17.10 uses dash instead of bash for default shell.

Ubuntu 17.10 uses Dash as the default shell. Previously, Ubuntu 10.04-17.04 had the default shell as Bash. Dash startup time is faster due to the 93% smaller codebase vs. Bash. Dash also may be less likely to have security vulnerabilities due to the smaller codebase.

How to specify shell to run script

The shell is selectable in the shebang at the top of the .sh file. here is an example .sh file

#!/bin/bash

[[ 1 -eq 0 ]] &&  { echo true; }  || { echo false; }

In Dash this script will simply crash due to incompatible syntax, but Bash runs this happily.

Typically it will be

#!/bin/sh

Which just means use any shell installed

If your script is more complicated, you might consider using shebang

#!/bin/bash 

if appropriate.

Tags:

Categories:

Updated:

Leave a Comment