#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.16
TRX 0.16
JST 0.031
BTC 59013.49
ETH 2516.64
USDT 1.00
SBD 2.48