commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
With thanks to dew on Efnet's #regex, back in 2005.
This version indents subsequent lines after the first by one space, to make paragraphs visibly obvious -- remove the \3 to prevent this behavior.
Lines are only broken at spaces: long strings with no spaces will not wrap, so URLs are safe.
Replace the "75"s to make the regex linewrap to other amounts.
From the unix commandline, "fold" is likely your better choice, but this snippet is handy in editors which allow regular expressions, in scripting, and other such situations where "fold" is unavailable.
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.