Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: oneliner: autorun script when I save it in the editor

by reisinge (Hermit)
on Mar 30, 2017 at 06:06 UTC ( #1186449=note: print w/replies, xml ) Need Help??


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
    The delimiter line is a nice touch...

    And using $ARGV[1] instead of $ARGV[0] is good thinking! I now use it more as a perl -wc thingy... so I save, and know if the added code is syntax-error free (of course, most of the times it is still buggy)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1186449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2019-12-13 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?