User Tools

Site Tools


shell_builtins

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell_builtins [2012/08/07 10:37]
ginko created
shell_builtins [2012/08/07 10:47] (current)
ginko
Line 2: Line 2:
 ===== Ksh/Bash ===== ===== Ksh/Bash =====
 ==== String operations ==== ==== String operations ====
 +<code bash># Strip extension:
 +${var%.ext}
 +
 +# Strip filename (extract directory):
 +${path%/*}
 +
 +# Strip path (extract filename):
 +${path##​*/​}</​code>​
 ==== Variable assignation ==== ==== Variable assignation ====
 <code bash># Valeur par defaut: <code bash># Valeur par defaut:
 var2=${var1:​-valDef}</​code>​ var2=${var1:​-valDef}</​code>​
shell_builtins.txt ยท Last modified: 2012/08/07 10:47 by ginko