in reply to Golf: Length of longest line in a file

You could cheat I guess:

$ wc -L file

Replies are listed 'Best First'.
Re^2: Golf: Length of longest line in a file
by toolic (Bishop) on Jul 02, 2010 at 18:31 UTC
    ++ That's a good way of cheating, especially since I learned a new usage of wc today. That eluded my quick google search earlier today, which only seemed to drum up awk solutions.
Re^2: Golf: Length of longest line in a file
by Fox (Pilgrim) on Jul 05, 2010 at 10:53 UTC
    wc will count tabs (\t) as 8 characters and newlines (\n) as 0 though,
    don't know if it supposed to be like that, but it does:
    $ hexdump test 0000000 0a09 0000002 $ wc -cm test 2 2 test $ wc -L test 8 test $