mirror of
https://github.com/ericonr/dotfiles.git
synced 2024-04-21 09:12:33 -05:00
25 lines
336 B
Bash
Executable File
25 lines
336 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# script to automate generation of executable shell scripts
|
|
|
|
FILE=$1
|
|
SHELL=$2
|
|
|
|
if [ -z $FILE ]
|
|
then
|
|
echo "No file name specified."
|
|
exit
|
|
fi
|
|
|
|
if [ -e $FILE ]
|
|
then
|
|
echo "File already exists."
|
|
exit
|
|
fi
|
|
|
|
printf "#!/usr/bin/env ${SHELL:-bash}\n\n\n" > $FILE
|
|
|
|
touch $FILE
|
|
chmod +x $FILE
|
|
exec ${EDITOR:-nvim} $FILE '+$'
|