Skip to content

Instantly share code, notes, and snippets.

@iwill
Created March 25, 2014 02:26
Show Gist options
  • Save iwill/9754203 to your computer and use it in GitHub Desktop.
Save iwill/9754203 to your computer and use it in GitHub Desktop.
newbash
# new bash script and mate
function newbash() {
if [[ ! -f "$1" ]]; then
echo '#!/bin/bash' > "$1"
fi
if [[ -f "$1" ]]; then
chmod +x "$1"
mate "$1"
fi
}
export -f newbash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment