Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Cygwin mounts Windows filesystems in /cygdrive/(drive letter)
- REPLACE_DIR="/cygdrive/c/Documents and Settings/Edwin/My Documents/replace"
- FIND_PATH="/cygdrive/c/"
- echo "Edwin's Big Fat Search & Replace Script"
- echo "Searching for:" $1
- find "$FIND_PATH" \( -path "$REPLACE_DIR" -prune \) -o -type f -name "$1" -print | while read FILE
- do
- echo "Found:" "$FILE"
- cp "$FILE" "$FILE".old
- echo "Renamed old version:" "$FILE".old
- cp "$REPLACE_DIR/$(basename "$FILE")" "$(dirname "$FILE")"
- echo "Copied" "$REPLACE_DIR/$(basename "$FILE")" "to location:" "$(dirname "$FILE")"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement