Download


scp vs. bashrc

Prepend this to .bashrc to make scp work. It suppresses echoing to stdout in scp shells.
# disable echo when running for scp
if [ -z "$PS1" ] ; then
function echo { 
   while [ "$1" ] ; do
      shift
   done
}
fi

make alias

This alias takes the pain of DOS-formatted Makefiles away.
alias make='if [ `file Makefile | grep -c CRLF` != 0 ] ; then echo "Makefile contains CRLF, converting." ; dos2unix --quiet Makefile ; chmod 775 Makefile ; fi ; make'

d2u

Runs dos2unix on a file but will preserve the file's permissions.
Get the source

me shell

A polyglot script that runs on both Windows and UNIX.
@goto windows \
2>/dev/null

   echo "Running on Linux/MacOS"
   [... more bash commands here ...]

exit 0
:windows

   @echo Running on Windows
   [... more DOS commands here ...]