I am new to scripting and I have a task which consists of extracting a version from a LOC and save it to $VERSION. The line looks like this:
#define PROJECT_VERSION "21.02"
I have to extract "21.02" and save it in $VERSION, using bash. Right now, I am using the following command:
awk '/PROJECT_VERSION/{print $NF}' common/ESUtils.cpp
but it return more strings. Can you help me?
awk '/PROJECT_VERSION/{print $NF}' fileshould work for you, what isbut it return more stringsyou are getting in output? Please explain it more.