[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Shell Golf



Here's the problem:

We have a directory of full of files, all perl scripts, ending in ".pl".

We want to know the length of the longest line, the file it comes from
and the line itself.

My solution clocks in at a hefty *59* characters. Any contenders?

perl -p -e '$_=length($_)." $ARGV $_"' *.pl|sort -n|tail -1

FYI, the end goal was to determine the minimal sdiff width required to
compare a bunch of files in two directories.

Mike808/

---------------------------------------------
http://www.valuenet.net



-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.