Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
だから、私は最初のスクリプトを作成しています.2つの異なるディレクトリからファイルを解凍し、それらのディレクトリを一緒にマージしてから、同じ名前のすべてのファイルを一緒に追加します. 私が苦労しているのは、同じ名前の複数のファイルを一緒に追加することだけです。それについて行く良い方法は何ですか?
それは各アーカイブのディレクトリ構造にもよるのですが、同じでしょうか? a/その場合、解凍されたファイルがとにあると仮定してb/、次のようにします。
a/
b/
mkdir c for f in a/*; do cat a/"$f" b/"$f" > c/"$f" done
cp2番目のディレクトリに使用する代わりに、
cp
for file in source/* ; do cat "$file" >> target/"${file#*/}" done