Skip to content

Instantly share code, notes, and snippets.

@rctay
Created August 28, 2010 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rctay/555079 to your computer and use it in GitHub Desktop.
Save rctay/555079 to your computer and use it in GitHub Desktop.
[msys] strip out cygwin paths
#
# Strip out cygwin paths from your PATH. Assumes that your cygwin directories
# have the word cygwin in their names - if not, change the regex pattern
# appropriately.
#
# Useful for users who are using both msys/mingw and cygwin - put this in your
# ~/.profile so that msys doesn't use them.
#
export PATH="$(echo -n $PATH | awk '
BEGIN { RS=":"; output="" }
!/cygwin/ { output = (output == "") ? $0 : output":"$0 }
END { print output }
')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment