xとx + n行のマージ

xとx + n行のマージ

私は15行のタイトルと15行のURLを返すスクリプトを書いています。

title 1
title 2
title 3
*snip*
title 14
title 15
http://example.com/query?1
http://example.com/query?2
http://example.com/query?3
*snip*
http://example.com/query?14
http://example.com/query?15

次のような出力を生成する方法で結合したいと思います。

title 1 http://example.com/query?1
title 2 http://example.com/query?2
title 3 http://example.com/query?3
*snip*
title 15 http://example.com/query?15

照明の点検と案内後この回答、コマンドが見つかりましたpaste。しかし、paste上記のようなより複雑な動作は許されない。上記の動作を実行するために使用できる他のツールやツールの組み合わせはありますか?

可能であれば、すべての標準coreutilsアクションを使用したいと思います。

ベストアンサー1

prあなたはコマンドを探しています

pr -2t -s" " file

おすすめ記事