Extract directoty from full file name?

view full story

http://www.unix.com – I think I know what this is doing, but the 'eval' is confusing Code: fname=$(echo ${lineItem} | awk 'BEGIN {FS=";"}{print $1}') fname=${fname%%+([[:space:]])} fname=${fname##+([[:space:]])} eval "fname=${fname}" The first line extracts the contents of the line preceeding the ";" 2nd & 3rd lines trim the value (I think .. not sure what the +([[:space:]]) does ..) But what would be the purpose of the eval statement? (HowTos)