#Bash + common linux utilities, 51
Bash + common linux utilities, 51
- 2 bytes saved thanks to @jimmy23013
- 2 bytes saved thanks to @AdamKatz
#'><}{][)(' `P5BD706D5AC79E196iFe- cd` rt|ver|
\cat
Normal reversion:
tac\
|rev|tr `dc -eFi691E97CA5D607DB5P` '()[]{}<>'#
Visual reversion:
tac\
|rev|tr `dc -eFi691E97CA5D607DB5P` ')(][}{><'#
The main trick here is that the string ()[]{}<>
is encoded as 691E97CA5D607DB5 (base 15). The resulting dc
command will yield this same result after either kind of reversion. However the '()[]{}<>'
string literal is sensitive to the reversal type.
tac
is required to reverse order of input lines and rev
is required to reverse the characters of each line. Any ASCII input should be acceptable.