in reply to oneliner: autorun script when I save it in the editor
Nice one! I modified it a bit to compile and run a C program:
perl -E 'while(-f $ARGV[1]){ $now=(stat(_))[9]; system("@ARGV"), print + "-" x 80, "\n" if ($now-$prev); $prev=$now; sleep 1 }' gcc a.c \&\& +./a.out
I think every Unix/Linux sysadmin should know shell (sh or bash) plus one of Perl, Ruby, Python. It doesn't matter which. -- Tom Limoncelli (http://everythingsysadmin.com/2012/06/salang.html)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: oneliner: autorun script when I save it in the editor
by FreeBeerReekingMonk (Deacon) on Apr 02, 2017 at 17:43 UTC |
In Section
Cool Uses for Perl