Table of Contents

Shell Built-ins

Ksh/Bash

String operations

# Strip extension:
${var%.ext}
 
# Strip filename (extract directory):
${path%/*}
 
# Strip path (extract filename):
${path##*/}

Variable assignation

# Valeur par defaut:
var2=${var1:-valDef}