I am attempting to write a script to list all the shebang lines in python files.
What I would like to do is
sudo bash -c 'for logf in $(find / -name "*.py"); do fgrep '#!/usr/bin' "$logf"; done'
This gives error
bash: !/usr/bin': event not found. I understand why, although the meaning of the error is unclear.
The trouble is I can't figure out how to pass a string to
bash which includes another string without command execution.
If I leave off the "#!" it works, but of course includes a number of other lines.
I have tried practically every combination of escape and string without success.