Created
June 2, 2016 20:40
-
-
Save chodorowicz/73de5124068ab6e417097814d47c9980 to your computer and use it in GitHub Desktop.
fswatch + xargs + duck + export variables to environment to go around xargs 255 bytes limit when expanding command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export syncpath="/path/to/folder/" | |
| export remotepath="sftp://[email protected]:2222/remote/path/" | |
| export duckParameters="-y -existing overwrite -p PASSWORD --upload"; | |
| fswatch -0 ${syncpath} | xargs -0 -I % -t bash -c 'f="%"; rel=${f#"${syncpath}"}; duck ${duckParameters} ${remotepath}${rel} "${f}"; echo ${rel};' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment