Search Results

Search: Posts Made By: gdub
15,533
Posted By bartus11
Try:STR="bla bla bla [123] bla bla" ...
Try:STR="bla bla bla [123] bla bla"
RUNID=$(echo ${STR} | awk -F'[\\[\\]]' '{print $2}')
echo ${RUNID}
BTW, if you wanted to use backticks (`) and (") you would need to do this to make it work...
15,533
Posted By Scrutinizer
awk -F'[][]' '{print $2}'
awk -F'[][]' '{print $2}'
15,533
Posted By bartus11
awk -F"[\\\[\\\]]" '{print $2}' fileDon't ask how...
awk -F"[\\\[\\\]]" '{print $2}' fileDon't ask how it works, cause I have no idea ;)
Another way, with a little less escaping:awk -F'[\\[\\]]' '{print $2}' file
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy