Advertisement
cd62131

join files

Mar 4th, 2019
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.19 KB | None | 0 0
  1. #!/bin/bash
  2. base='hoge_base.txt'
  3. files=('hoge2.txt' 'hoge3.txt')
  4. join='|join -o auto -a1 -e "---" -'
  5. cmd="cat ${base}"
  6. for f in "${files[@]}"; do cmd+="${join} ${f}"; done
  7. eval "${cmd}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement