Где блекджек, где мои шлюхи? Ничерта не работает! Войти !bnw Сегодня Клубы
УНЯНЯ. У нас есть немножечко инфы об этом пользователе. Мы знаем, что он понаписал, порекомендовал и даже и то и другое сразу. А ещё у нас есть RSS.
Теги: Клубы:

Вот тут у меня бомбануло от наркоманского седовсокого синтаксиса.
Чем конкретно этот пример лучше, что говноскрипт на питушоне(или любом другом языке) такого же размера?

https://stackoverflow.com/questions/4331851/sed-swapping-2-lines

sed -n ' # turn off default printing
/dog/{ # if the line matches "dog"
h # put it in hold space
:a # label "a" - the top of a loop
n # fetch the next line
/something/{ # if it matches "something"
p # print it
x # swap hold and pattern space
bb # branch out of the loop to label "b"
} # done with "something"
# if we're here, the line doesn't match "something"
H # append pattern space to hold space
x # swap hold and pattern space
s/\([^\n]*\)\n\([^\n]*\)$/\2\n\1/ # see below
x # swap hold and pattern space
ba # branch to the top of the loop to label "a"
} # done with "dog"
:b # label "b" - outside the loop
# print lines that don't match and are outside the pair
p # also prints what had been accumulating in hold space
' inputfile

#TCBPR5 (40) / @ninesigns / 3603 дня назад
ipv6 ready BnW для ведрофона BnW на Реформале Викивач Котятки

Цоперайт © 2010-2016 @stiletto.