Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable shebang line

#!/usr/bin/perl

This is the shebang line to a lot of scripts I'm writing lately.

Hard coding the path of the binary seems like it could create some problems. For instance, if one of my users has Perl installed at /something_else/bin then they'd have to change all the shebangs.

I've seen some tools that will automatically replace the shebangs, but I'm wondering if there is something simpler.

like image 845
Mike Avatar asked May 17 '10 00:05

Mike


1 Answers

env(1)

#!/usr/bin/env perl
like image 196
Ignacio Vazquez-Abrams Avatar answered Sep 21 '22 02:09

Ignacio Vazquez-Abrams