Reputation: 129
I have a line as below,
`string;{env=>{world=>is,always=>beautiful,gods=>grace}}`
I want to print to do some regex awk to print as below,
`string : env`
I can do it using cut to print "env" but not sure how to do print two strings.
Upvotes: 2
Views: 60
Reputation: 785058
You can try this awk:
s='string;{env=>{world=>is,always=>beautiful,gods=>grace}}'
awk -F '[;{}=]+' '{print $1, ":", $2}' <<< "$s"
string : env
Upvotes: 2