Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created August 20, 2015 14:28
Show Gist options
  • Select an option

  • Save bdkosher/3be94e379c03fdadbb40 to your computer and use it in GitHub Desktop.

Select an option

Save bdkosher/3be94e379c03fdadbb40 to your computer and use it in GitHub Desktop.
I use Windows and throw a bunch of .bat files in a PATH directory that run tools (mvn, gradle, etc.). This lets me avoid having to set each tool's /bin folder on my PATH. However, Cygwin doesn't work with .bat files, so this .bashrc snippet will create an alias for all the batch files based on their names.
BATCH_FILES=/cygdrive/c/Users/jwolf2/bin/*.bat
for bfile in $BATCH_FILES; do
bname=${bfile##*/}
bcmd=${bname%.*}
alias $bcmd=$bfile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment