I'm trying to copy over only specific words from 1 text file to another.
this is what is inside my username2.txt:
jason,visitor
mark,staff
orlando,visitor
I'm trying to copy over only jason and orlando to another txt file so it'll just be like:
jason
orlando
this is currently my bash script (as of right now, it only creates a blank txt file):
#!/bin/bash
username="username2.txt"
while IFS=, read username1 group1; do
if [ $group1 = "visitor" ]; then
awk $username1 $username > reportvisitors.txt
fi
done < $username