Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:f64b634dd8
This commit is contained in:
25
dots/.bin/script
Executable file
25
dots/.bin/script
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user