I have this line
"sha": "60dede389922f81a64ddb5f30ab6fe8a73deb643",
How to use sed or awk to print only 60dede389922f81a64ddb5f30ab6fe8a73deb643 ?
I have use
awk '/sha/{print $1, $NF}' | sed 's/[^0-9]\{4\}//g'
But I have got wrong vaule
60389922f81a64ddb5f30ab6fe8a73deb643",
>Solution :
What I would do:
awk -F'"' '/^"sha"/{print $4}' file
But I prefer this grep version:
grep -oP '^"sha":\s+"\K[[:xdigit:]]+' file

If the file is JSON, you need jq with something like:
jq -r '.sha' file.json