[clug] Redirect time command output to file

Alex Satrapa grail at goldweb.com.au
Thu May 27 21:11:44 MDT 2010


On 28/05/2010, at 10:16 , Kevin Pulo wrote:

> Which reminds me - supposing you want to run a real command (not a
> builtin), but you don't know (or care) the absolute path, and you
> don't want to parse $PATH manually (nor should you), then the Right
> Way to do it (in bash) is to use the "command" builtin.

Or env :)

Wrong way:

PERL=`which perl`
$PERL stuff

Better way:

/usr/bin/env perl stuff

So in your scripts:

#!/usr/bin/env perl

or 

#!/usr/bin/env python

This is especially useful for folks using Python since we often have three or four different versions of the interpreter installed, much less the dozens of development environments to reflect the diaspora of servers our code will end up living in >.<

Alex



More information about the linux mailing list