danielhilst

dd of= to multiple files using process substitution

Feb 8th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. 03:27 < e36freak> while read -r line; do ...; done < "$file"
  2. 03:27 < geckos> Zer000: i think that too
  3. 03:27 < e36freak> you also see it used without redirection, such as:
  4. 03:27 < e36freak> comm -13 <(sort file1) <(sort file2)
  5. 03:28 < e36freak> >(...) can be used with, say: cmd1 | tee >(cmd2 > file) | cmd3
  6. 03:28 < qman__> zcat image.gz | tee >(dd of=/dev/sda1) | tee >(dd of=/dev/sdb1)
  7. | dd of=/dev/sdc1
  8. 03:28 < geckos> e36freak: I see
  9. 03:28 < e36freak> qman__: nice example
  10. 03:28 < qman__> one gunzip, three simultaneous writes
  11. 03:29 < e36freak> though you could just use one tee; zcat foo.gz | tee >(dd
  12. of=/dev/sda1) >(dd of=/dev/sdb1) | dd of=/dev/sdc1
  13. 03:29 < geckos> qman__: wow thats pretty cool
  14. 03:29 < qman__> ah, didn't know tee accepted multiple args like that
  15. 03:29 < e36freak> aye
Advertisement
Add Comment
Please, Sign In to add comment