Answers for "grep extract substring"

0

grep for substring

output=$(command)
[[ $output =~ (CpuIowait=[0-9][.][0-9]{2}) ]] && echo "${BASH_REMATCH[1]}"
Posted by: Guest on April-05-2021
0

grep extract only matched string

grep -E -o "insert regex here"
Posted by: Guest on July-07-2020

Code answers related to "grep extract substring"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language