Originally Posted by
dwhitney67
How does one then remove the space at the end of the resulting 'series_name'?
If the file has the format of "foo foo - 3x11", and I use the statement you have shown above, the resulting 'series_name' is "foo foo " (note the trailing white-space).
P.S. I ask the simple question above because, believe it or not, earlier today I thought of the suggestion you offered, and naturally I encountered a problem with it.
have you tried sed?
Code:
series_name=`echo $1 | awk -F"-" '{ print $1 }' | sed 's/ $//'`
or awk
Code:
series_name=`echo $1 | awk -F"-" '{ print $1 }' | awk '{ sub(/ $/, ""); print }'
i'm sure this can be done with only one pipe, but i'm not quite sure how....
Bookmarks