summaryrefslogtreecommitdiff
path: root/newscript
blob: 709d592eb77205c05ddcb4add0fdb06e2ff2b19f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh

newscript ()
{
    if [ -z "$1" ]; then
        echo "Usage: newscript <script-name>"
        return 1
    fi
    local name=$1
    cd ~/.scripts && touch "$name" && printf "#!/bin/sh\n\n" > "$name" && vim +2 "$name" && chmod +x "$name" && cd -
}

newscript $1