Category Archives: Bash

Bash quote trap: why rsync exclude pattern not work

A friend wanted to sync all his files to a remote host, exluding the source files(those with suffix .c, .cpp, .h, .hpp). First I wrote this script #!/bin/bash ####sync.sh (version 1): sync files to remote host### SYNC_DST=’xxx@example.com::sample_project’ SYNC_OPT=’ –exclude=”*.[ch]” –exclude=”*.[ch]pp” … Continue reading

Posted in Bash, Programming, System Administration | Tagged , , , | 2 Comments