Permalink
Browse files

Simpler solution

  • Loading branch information...
1 parent 07a1ed1 commit 804de4187710609e3e00db77f1c535fc0d01fd16 @l0b0 l0b0 committed Jun 11, 2012
Showing with 1 addition and 12 deletions.
  1. +1 −12 split-lines.sh
View
@@ -31,15 +31,4 @@
#
################################################################################
-awk '
-{
- if (length() > 76) {
- printf("%s\r\n ", substr($0, 1, 75));
- $0 = substr($0, 76);
- while (length() > 75) {
- printf("%s\r\n ", substr($0, 1, 74));
- $0 = substr($0, 75);
- }
- }
- print $0;
-}' "$@"
+sed -e '{ s/\(.\{75\}\)\([^\r]\)/\1\r\n \2/; P; D }' "$@"

0 comments on commit 804de41

Please sign in to comment.