shell_builtins
Differences
This shows you the differences between two versions of the page.
shell_builtins [2012/08/07 10:37] – created ginko | 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## | ||
==== Variable assignation ==== | ==== Variable assignation ==== | ||
<code bash># Valeur par defaut: | <code bash># Valeur par defaut: | ||
var2=${var1: | var2=${var1: |
shell_builtins.txt · Last modified: 2012/08/07 10:47 by ginko