I'm trying to extract each username value in clients object and store in array (bash). However, grep failed to match even through matched in regex101.com
//a.txt
username = "fakeuservalue"
clients = [
{
username = "user1"
},
{
username = "user2"
}
]
x=$(cat a.txt | grep -e 'username\s+=\s+\"(.*)\"')
echo $x
Any clues? I'm also try to add another check on "clients" object so that skip retrieve "fakeuservalue".