#Linux Function/alias to snap create an executable bash script with the Vim editor.

in #linux7 years ago (edited)

This function will create and simultaneously open an executable file with the sha-bang line on his top and the input cursor two line below. Typical usage: vix myscript.sh

vix() {
   [ -e "$1" ] || echo -e '#!/bin/bash\n\n' > "$1";
   chmod +x "$1";
   vi "+normal G" +startinsert "$1"
   }

GitHub

Coin Marketplace

STEEM 0.25
TRX 0.14
JST 0.034
BTC 50900.88
ETH 2931.93
USDT 1.00
SBD 4.24