Files
nix/dots/.bin/script
T
hektor 71725ce35b Add 'dots/' from commit '357b97a7692c8d5ec9666d8d7d7c98d81cb51cf0'
git-subtree-dir: dots
git-subtree-mainline: 2ad98cde17
git-subtree-split: 357b97a769
2025-10-04 18:28:04 +02:00

26 lines
335 B
Bash
Executable File

#!/usr/bin/env bash
# Script to create script
if [ -z "$1" ]; then
echo "Usage: script <scriptname>"
exit
fi
path="$HOME/.bin/$1"
# Prevent overwriting existing script
set -o noclobber
# Create script
cat > "$path" << EOF
#!/usr/bin/env bash
EOF
chmod +x "$path"
# Open script in editor on line 3
"$EDITOR" +3 "$path"