I'm trying to awk a file which contains a list of names mapped to DOB in DD-MM format.
The match didn't work in attempt 1), so I tried to run it on the command line as per attempt 2), but that still didn't work. Any suggestions?
Thanks
file.txt
jason 08-04
ATTEMPT 1
XXXXXX$ cat a.txt
#!/bin/bash
file="file.txt"
current_date=$(date +%d-%m)
awk -F" ", 'if ($2==$current_date) print $1)' "$file"
ATTEMPT 2
awk -F" ", '{
if ($2=='08-04')
print "$1"
}' file.txt