OpenVas + Kali Rolling: Соединение было сброшено

Вы можете сделать это с помощью sed следующим образом:

sed ':n; N; s/\n[^ ]/&/; tsplit; s/^\([^ ]* *\)\([^ ]*\n\) *\([^ ]*\)$/\1\2\1\3/; :split; h; s/\n.*$//; p; g; s/^.*\n//; bn' test.txt

Explanation

sed '# Start label for loop
:n
# Read next string to main buffer, separated by "\n"
N
# Split and print first string if second starts with non-space character
s/\n[^ ]/&/
tsplit
# "^\([^ ]* *\)" -- First word with spaces, \1.
# "\([^ ]*\n\)"  -- Second word, \2.
# " *"           -- Spaces in second line, throw them.
# "\([^ ]*\\)"   -- Second word in second line, \3.
s/^\([^ ]* *\)\([^ ]*\n\) *\([^ ]*\)$/\1\2\1\3/
# Splitting
:split
# Send both lines to hold buffer
h
# Delete second line, print first
s/\n.*$//
p
# Lines to main buffer, delete first.
g
s/^.*\n//
# Now second file is first, start loop again.
bn' test.txt
2
17.03.2016, 18:39
0 ответов

Теги

Похожие вопросы