bash suffix removal

Donn donn.ingle at gmail.com
Fri Jan 25 23:49:43 UTC 2008


Hi, here's what I made a note of:

$ var=file.jpg
To remove at end: %:
$ echo ${var%jpg}
file.

To remove at start: #:
$ echo ${var#file}
.jpg

To kill entire type:
$ echo ${var%.*}
file

HTH,
\d

Fonty Python and other dev news at:
http://otherwiseingle.blogspot.com/




More information about the kubuntu-users mailing list