在an answer的評論中,開始討論與使用GNU coreutils'join
創建兩個文件的笛卡爾乘積。一位同行的用戶建議:使用加入笛卡爾產品
$ join -j 2 -t '' file1 file2
生產和file1
笛卡爾積file2
:
$ cat file1
1
2
$ cat file2
a
b
預期輸出:
$ join -j 2 -t '' file1 file2
1a
1b
2a
2b
嗯,我越來越:
$ join -t '' -j 2 file1 file2
1
a
1
b
2
a
2
b
我已經在C和en_US.utf8語言環境(所有系統由不同方安裝和管理)中測試了Debian Jessies(join
(GNU coreutils)8.23)和Ubuntu Trusty Tahr(join
(GNU coreutils)8.21)。據報道,join
在OS X和一個帶有join
(GNU coreutils)8.22的系統中表現如預期。
有沒有人碰到過這個?我究竟做錯了什麼?
嘗試過了,有你需要的輸出: '的bash-3.00 $加入-j 2 -t 「」 T1 T2 1A 1B 2A 2b' 也試過它在tcsh和csh,它也在那裏工作。檢查你的unix karnel的某些部分是否搞亂了。 – user2141046
@ user2141046你還在bash 3?請更新你的系統和'加入'版本('join --version')? –
加入(GNU coreutils)8.12 – user2141046