Guest User

Untitled

a guest
Oct 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function xmap() {
  2. # Run a shell command once for every argument passed. The first argument
  3. # should be a single-quoted string appropriate to pass to sh -c.
  4. # For example:
  5. # % xmap 'echo @' foo bar baz
  6. # echo foo
  7. # echo bar
  8. # echo baz
  9.  
  10. cmd=$1
  11. shift
  12.  
  13. echo -n ${@} | xargs -r -d" " -I@ sh -c "${cmd}"
  14. }
Add Comment
Please, Sign In to add comment