I want to find out all scripts with a specific shebang line. Specifically, I want all files that match the following criteria:
- It's mostly a plain text file (stuffs created by
gzexedon't look very friendly)
- The 1st line contains solely
#! /bin/sh(with a space)
I would like to do this with
File names are useless, because some scripts don't have extensions or even have wrong extensions. Also a
something.sh may have a shebang line of
#!/bin/bash which is also not what I wanted.
Besides, sometimes I would come across a file like this:
The 1st line is empty and the shebang is located at the 2nd line, which is not what I wanted.
I am able to find shebang lines with
find|grep but I don't know how to find lines specifically on the 1st line of a file.
Thanks for any help in advance.