TL; DR
Daha tutarlı sonuçlar elde etmek için paste/ columnyerine bir kombinasyon kullanmayı düşünün pr.
İşletim sisteminize bağlı olarak, prgiriş uzunlukları farklı olduğunda (Ubuntu, macOS) veya daha da kötüsü, her girişi tamamen farklı sayfalara yazdırır (Centos 7)
pr yabancı çıktıları hem ekler hem de ekler
BİÇİM:
paste <(cmd1) <(cmd2) | column -s $'\t' -t
Detaylı açıklama
pasteVe columnkomutlarının bir kombinasyonu ile oldukça sağlam bir çözüm mümkündür .
paste/ columnYaklaşımın avantajları pr:
Somut örnek:
paste <(ls -1 .) <(ls -1 ..) | column -s $'\t' -t
Ubuntu 16.04'te gerçek hayat paste/ columnteknik:
jay-z@jaytaylor.com:~/go/src/github.com/jaytaylor/html2text
$ paste <(ls -1 .) <(ls -1 ..) | column -s $'\t' -t
LICENSE archiveify
README.md go-hostsfile
html2text.go html2text
html2text_test.go jaytaylor
testdata mockery-example
shipbuilder
stoppableListener
tesseract-web
Karşılaştırma için: prçeşitli platformlarda
TL; DR: pr Linux lezzetlerinde davranış tutarsız.
Ubuntu'dapr sürüm çıktısı :
jay-z@jaytaylor.com:~/go/src/github.com/jaytaylor/html2text
$ pr -m <(ls -1 .) <(ls -1 ..)
2017-05-25 15:50 /dev/fd/62 Page 1
LICENSE archiveify
README.md go-hostsfile
html2text.go html2text
html2text_test.go jaytaylor
testdata mockery-example
shipbuilder
stoppableListener
tesseract-web
Çıktı prüzerinde sürümü OS X / MacOS :
jay-z@jaytaylor.com:~/go/src/github.com/jaytaylor/html2text
$ pr -m <(ls -1 .) <(ls -1 ..)
May 25 08:55 2017 Page 1
LICENSE archiveify
README.md go-hostsfile
html2text.go html2text
html2text_test.go jaytaylor
testdata mockery-example
shipbuilder
stoppableListener
tesseract-web
<... remainder of screen filled with blank lines ...>
Centos'takipr sürüm çıktısı :
(Şaşırtıcı bir şekilde prCentos 7'nin altındaki davranış, test edilen tüm diğer platformlardan farklıdır)
jay-z@jaytaylor.com:~/go/src/github.com/jaytaylor/html2text
$ pr <(ls -1 .) <(ls -1 ..)
2017-05-25 15:59 /dev/fd/63 Page 1
LICENSE
README.md
html2text.go
html2text_test.go
testdata
<... remainder of screen filled with blank lines ...>
2017-05-25 16:21 /dev/fd/62 Page 1
archiveify
go-hostsfile
html2text
jaytaylor
mockery-example
shipbuilder
stoppableListener
tesseract-web
<... remainder of screen filled with blank lines ...>
pr -mbirini kullanabilirsinizpaste.