Last active
April 13, 2024 12:21
-
-
Save mhrstmnn/811b0c75acee5b69bcc0112a3e7a99fd to your computer and use it in GitHub Desktop.
A script to create new scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
OUTPUT='#!/bin/zsh\n\n# TODO' | |
FILENAME='empty_script.sh' | |
if [ $# -ne 0 ]; then | |
if [[ "$*" == *.* ]]; then | |
FILENAME="$*" | |
else | |
FILENAME="$*.sh" | |
fi | |
fi | |
echo $OUTPUT > $FILENAME | |
chmod +x $FILENAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment