Skip to content

Instantly share code, notes, and snippets.

@yjh0502
Created December 19, 2016 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yjh0502/1355939dc89a055029d1161e5501a50a to your computer and use it in GitHub Desktop.
Save yjh0502/1355939dc89a055029d1161e5501a50a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
mkdir -p foo bar
seq -w 0 100 | xargs -n1 -I{} touch foo/{}.c
echo '["subscribe","./","mysub",{"fields":["name"],"expression":["allof",["type","f"],["not","empty"],["suffix","c"]]}]' | watchman -p -j --server-encoding=json > /dev/null &
while true; do find bar/ -type f | xargs -n1 -P5 -I'{}' mv '{}' foo; done &
while true; do find foo/ -type f | xargs -n1 -P5 -I'{}' mv '{}' bar; done &
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment