Skip to content

Instantly share code, notes, and snippets.

@westonruter
Created August 18, 2011 18:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save westonruter/1154817 to your computer and use it in GitHub Desktop.
Save westonruter/1154817 to your computer and use it in GitHub Desktop.
Echo and pbcopy the URL for the given SVN working copy
#!/bin/bash
# Prints and copies to the clipboard the SVN URL of the current working
# directory or the first command line argument
# by @westonruter; use of awk and tr thanks to @josh_wnj
if [ $# == 0 ]; then
cwd=`pwd`
else
cwd="$1"
fi
url=`svn info $cwd | grep 'URL:' | awk '{print $2}' | tr -d '\n'`
echo $url | pbcopy
echo $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment