Python の練習
#!/usr/bin/python3
import sys
if len(sys.argv) < 3:
raise Exception("arguments too short")
# 最初の引数は自分自身なので削除
sys.argv.pop(0)
# 最後の引数は出力ファイル(残りは結合したいファイル)
writefile = sys.argv.pop(-1)
with open(writefile, "wb") as w:
for arg in sys.argv:
with open(arg, "rb") as r:
w.write(r.read())