linux - Take part of the string using bash -
linux - Take part of the string using bash -
this question has reply here:
how extract string next pattern grep, regex or perl 7 answersi have string log file sending code like:
<timestamp> info [response--22] code [00000000] code sent [+0000002345]
could help me parsing using bash set code value (8chars) variable? give thanks help.
you utilize sed extract value:
sed 's/.*code *\[\([0-9]*\)].*/\1/' <<<"<timestamp> info [response--22] code [00000000] code sent [+0000002345]" 00000000
if line in file, can sed '...' filename
. store output variable, can x=$(sed '...' filename)
.
linux bash parsing git-bash
Comments
Post a Comment