Skip to main content
added 36 characters in body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 
fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 
$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.+/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.+/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.+/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

edited body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.*+/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.*/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.+/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

added 1 character in body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268

#Bash + GNU utilities, 205204

fold -$1|sed -r 2~2{s/.+\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.*/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 205

fold -$1|sed -r 2~2{s/.+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.*/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

#Bash + GNU utilities, 204

fold -$1|sed 2~2{s/.\\+/printf\ %$1's "`echo "&"|rev`"/e y/'`printf %s {A..Z} {a..z}`"&_?!\"'.,/∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Zɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz⅋‾¿¡„,˙'/ }" 

N is given on the command line and S is given via STDIN:

$ echo "The quick brown fox jumps over the lazy dog." | ./boustrophedon.sh 30 The quick brown fox jumps over ˙ƃop ʎzɐl ǝɥʇ $ 

###Explanation

  • fold -N splits the input into lines of length N.
  • The rest of the processing is done by sed, line-by-line:
    • 2~2 matches every other line, starting at line 2
    • s/.*/printf %'N's "`echo "&"|rev`"/e uses GNU Sed's exec feature to call a shell to reverse the line and left-pad it with up to N spaces
    • y/ABC.../∀qƆ.../ transform characters

Note ABC... is generated using a bash expansion and printf. Also some fancy quoting for all the different characters.

deleted 192 characters in body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268
Loading
Fixed backticks
Source Link
izzyg
  • 42.3k
  • 5
  • 79
  • 216
Loading
deleted 286 characters in body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268
Loading
added 734 characters in body
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268
Loading
Source Link
Digital Trauma
  • 73.8k
  • 10
  • 117
  • 268
Loading