Skip to content

Instantly share code, notes, and snippets.

@jackdalton
Created December 26, 2015 08:14
Show Gist options
  • Save jackdalton/8a27ba1a35fab521811a to your computer and use it in GitHub Desktop.
Save jackdalton/8a27ba1a35fab521811a to your computer and use it in GitHub Desktop.
Update GitHub repo links in a directory
[jack@arch]$ ls -R testdir
testdir:
a.txt testdir2
testdir/testdir2:
b.txt
[jack@arch]$ cat testdir/a.txt
def
[jack@arch]$ cat testdir/testdir2/b.txt
def123
[jack@arch]$ python replacelinks.py
Target directory? : testdir
Current text? : def
Desired text? : abc
Wrote to testdir/a.txt .
Wrote to testdir/testdir2/b.txt .
Target string replaced 2 times.
[jack@arch]$ cat testdir/a.txt
abc
[jack@arch]$ cat testdir/testdir2/b.txt
abc123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment