sed on AIX and HP-UX
Hello all,
I'm facing this issue in my attempt to use sed to extract a variable number from a string I do have something like this: file_fruxt0000006_5300-12_20140601152 file_fruxt0000036_6100-12_20140601 I'd like to extract the last number from the string |
Does
Code:
echo file_fruxt0000006_5300-12_20140601152 | sed 's/.*_//' |
Quote:
meantime I realized I can use awk -F_ '{print $NF}' |
Or just:
Code:
X='file_fruxt0000006_5300-12_20140601152'; echo "${X##*_}" |
All times are GMT -5. The time now is 04:32 PM. |