Skip to content

Instantly share code, notes, and snippets.

@markrendle
Created June 20, 2012 14:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markrendle/2960254 to your computer and use it in GitHub Desktop.
Save markrendle/2960254 to your computer and use it in GitHub Desktop.
Shell script to launch Visual Studio with either named sln or most recently modified
if [ -n "$1" ]; then
file=$1
else
file=( $(ls -xt *.sln | head -n1))
fi
if [ -z "$file" ]; then
echo "No solution found."
exit 1
fi
/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 11.0/Common7/IDE/devenv.exe "$file" &
@markrendle
Copy link
Author

Also, add:

alias vs=[put path here]/vs.sh

to your ~/.bashrc for convenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment