I'm finding a behaviour I can't really explain with awk. Maybe it's a silly mistake but I can't figure it out.
I have a file called files with some random filenames.
$ cat -e files
3beds.txt$
file4.txt$
file3.txt$
dedo$
file5.txt$
texto5.txt$
metoo.txt$
34lions$
texto2.txt$
file1.txt$
7hello$
summer$
missing$
hello.mundo$
helloWorld.txt$
texto3$
awkvars$
texto4$
yes$
file2.txt$
I want to print only the filenames containing digits. I used the command:
awk '/\d/{print $0}' files
But my result was:
$ awk '/\d/{print $0}' files
3beds.txt
dedo
hello.mundo
helloWorld.txt
I'd really appreciate it if someone can explain to me why those lines are being printed. Thank you!