I need help setting the output of the grep command below as a variable for each line.
while read line; do
grep -oP '@\K[^ ]*' <<< $line
done < tweets
Above displays what I want like this:
lunaluvbad
Mags_GB
And so on...
However if I would do something like:
while read line; do
usrs="grep -oP '@\K[^ ]*' <<< $line"
done < tweets
echo $usrs
It displays weird result, and certainly not the result I'm looking for. I need $usrs to display what I had mentioned above. Example:
lunaluvbad
Mags_GB