I have the following file:
$ cat files
foo.txt
bar.js
I am looking to use bash awk to only print files not ending with .js.
This works fine when using single quoted awk:
$ awk '$1 !~ /.js$/ {print $1}' files
foo.txt
However, when using double quoted awk:
$ awk "\$1 !~ /.js$/ {print \$1}" files
-bash: !~: event not found