"Taking a LiveFire Labs' course is an excellent way to learn
Linux/Unix. The lessons are well thought out, the material is
explained thoroughly, and you get to perform exercises on a real
Linux/Unix box. It was money well spent."
LiveFire Labs' UNIX and Linux Operating System Fundamentals
course was very enjoyable. Although I regularly used UNIX systems
for 16 years, I haven't done so since 2000. This course was a
great refresher. The exercises were fun and helped me gain a real
feel for working with UNIX/Linux OS. Thanks very much!"
${variable#pattern} - discards the smallest matching pattern; returns the rest
${variable##pattern} - discards the largest matching pattern; returns the rest
$ TEXT="livefire_labs_provides_online_unix_training_with_hands_on_lab_exercises"
$ print ${TEXT#*_}
labs_provides_online_unix_training_with_hands_on_lab_exercises
$
$ print ${TEXT##*_}
exercises
$
$ print ${PWD}
/export/home/livefire
$ print ${PWD##*/}
livefire
$
$ print $(basename ${PWD})
livefire
$
Read the NEXT article in this series - Pattern Matching - Substrings - Part II