Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Reverse-a-string/Sed/reverse-a-string.sed
Normal file
18
Task/Reverse-a-string/Sed/reverse-a-string.sed
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sed -f
|
||||
|
||||
/../! b
|
||||
|
||||
# Reverse a line. Begin embedding the line between two newlines
|
||||
s/^.*$/\
|
||||
&\
|
||||
/
|
||||
|
||||
# Move first character at the end. The regexp matches until
|
||||
# there are zero or one characters between the markers
|
||||
tx
|
||||
:x
|
||||
s/\(\n.\)\(.*\)\(.\n\)/\3\2\1/
|
||||
tx
|
||||
|
||||
# Remove the newline markers
|
||||
s/\n//g
|
||||
Loading…
Add table
Add a link
Reference in a new issue