in reply to Favourite One-liners?
where ptyexec is this. (You can just drop the ptyexec, though, if it gives trouble, it'll just truncate the output width to 80 chars, which is a little ugly).alias ww='watch '\''ptyexec w | perl -pe '\''\'\'''\''(print(" -1 "),n +ext) if $x++<2; ($i) = ($_ =~ /^.{42}\s+(\S+)/); $i=~/days/&&(print(" + 9999999999 "),next); $i=~/(?:(\d+):)?([\d.]+)([md]?)/; ($t=$1*60+$2) +; $3&&($t*=60); print sprintf(" %9d ",$t)'\''\'\'''\'' | sort -n | pe +rl -pe '\''\'\'''\''s/^\s+\S+\s+//'\''\'\'''\'''\'''
There's the ever-popular:
For fixing line-ends.perl -pi -e 's/\r\n?/\n/' *
And another simple one that I love because of how it demonstrates a neat concept is just:
(better known as "sum").something | perl -lne 'END{print$x}$x+=$_'
Update: added trailing slash to the line-end fixing regex. Thanks, tlm
------------ :Wq Not an editor command: Wq
|
---|