Add script to add script

master
Hektor Misplon 2022-10-27 03:18:56 +02:00
parent 64d92013c1
commit 0e69eb27bc
1 changed files with 17 additions and 0 deletions

17
.bin/script Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Script to create script
if [ -z "$1" ]; then
echo "Script name required"
exit
fi
path="$HOME/.bin/$1"
# Prevent overwriting existing script
set -o noclobber
# Create script
echo "#!/usr/bin/env bash" > "$path"
chmod +x "$path"