No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: ecw {http:#8203912}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
jmcg
EE Cleanup Volunteer
Main Topics
Browse All Topics





by: ecwPosted on 2003-03-25 at 08:25:22ID: 8203912
To strip off a known part,
${var%pattern} # shortest match
or ${var%%pattern} # longest match
Where pattern is a valid filename expansion pattern eg.
var=main.c.old
echo ${var%.*} ${var%%.*}
While output
main.c main
To get the first (for example 10) chars of a var
var=`echo $var | cut -c -10`
or var =`expr substr 1 10 $var`