Created
March 10, 2016 05:32
-
-
Save sordina/0efa2d02b1216c029f75 to your computer and use it in GitHub Desktop.
OS X Copy Current working directory relative to Home, with optional arg
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
#!/bin/bash | |
if [ ! "$1" ] | |
then | |
echo `pwd`/ | sed 's#^/Users/lyndon/#~/#' | tee /dev/stderr | tr -d '\n' | pbcopy | |
else | |
echo `pwd`/$1 | sed 's#^/Users/lyndon/#~/#' | tee /dev/stderr | tr -d '\n' | pbcopy | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment