回答編集履歴

1

追記

2022/10/17 12:32

投稿

退会済みユーザー
test CHANGED
@@ -1,2 +1,15 @@
1
- Pythonでプログラム書かずにシェルスクリプトでやっつけちゃうのはだめですか?
1
+ Pythonでプログラム書かずにシェルコマンドでやっつけちゃうのはだめですか?
2
2
  ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-10-17/f4ce0cdb-548d-4bde-8600-d772d7e5abc0.png)
3
+
4
+ ```shell
5
+ su507$ cat file1.txt
6
+ ["人","子供","青"]
7
+ ["うさぎ","さる","ねずみ"]
8
+ su507$ cat file2.txt
9
+ ["イタリア","フランス","スペイン"]
10
+ ["目","腹","頭"]
11
+ su507$ TEMP=$(mktemp); tail -r file1.txt > $TEMP; paste -d ',' file2.txt $TEMP | sed -e "s/\],\[/,/"; rm -f $TEMP
12
+ ["イタリア","フランス","スペイン","うさぎ","さる","ねずみ"]
13
+ ["目","腹","頭","人","子供","青"]
14
+ su507$
15
+ ```