#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.20
TRX 0.14
JST 0.030
BTC 68228.72
ETH 3279.36
USDT 1.00
SBD 2.67