Search Results

Search: Posts Made By: gdub
13,587
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...
13,587
Posted By Scrutinizer
awk -F'[][]' '{print $2}'
awk -F'[][]' '{print $2}'
13,587
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

 

Featured Tech Videos

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