I use awk
in the following command to return app names on my phone:
aapt dump badging App.apk | awk -F: '/label-uk/ {print $2}'
The problem is, I found that some of them use different labels like "label-en-GB" instead. So after some research, I thought I should add a pipe like so:
awk -F: '/label-uk|label-en-gb/ {print $2}'
But this returns duplicates for the apps that contain both terms, then I tried with two pipes, like so:
awk -F: '/label-uk/ || /label-en-gb/ {print $2}'
Both commands work, but both show duplicates.
Can awk
return only the first matching term instead of both?
Thank you!