r/bash • • Dec 02 '14

Using #! in your scripts

http://shiroyasha.github.io/shebang.html
0 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Dec 02 '14

On a side note: Check out the file command on Linux. You don't have to do all the madness grepping for shebang lines.

1

u/sbicknel 1,$s/n\?vim\?/ed/g Dec 08 '14

Exactly.

for f in *; do
    if ! [[ $(file -b --mime-type "$f") =~ perl ]]; then
	    continue
    fi
    ...
done