Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
linux_expr_command [2019/09/18 10:38] – rpjday | linux_expr_command [2019/09/18 10:44] (current) – rpjday | ||
---|---|---|---|
Line 62: | Line 62: | ||
Piece of cake. Note that this works for only one tagged field -- if you tag more than one, you get just the first. | Piece of cake. Note that this works for only one tagged field -- if you tag more than one, you get just the first. | ||
+ | |||
+ | P.S. If the string you're manipulating has only two fields of interest, or has multiple fields of which only the first and last will ever be of interest, then you can of course use standard variable substitution: | ||
+ | |||
+ | * ${var#ptn} | ||
+ | * ${var##ptn} | ||
+ | * ${var%ptn} | ||
+ | * ${var%%ptn} |