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

in #linux8 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.18
TRX 0.24
JST 0.034
BTC 96930.75
ETH 2663.20
USDT 1.00
SBD 0.43