Created
May 24, 2024 23:32
-
-
Save newbenhd/44426c10100f145c751c87a6f80df192 to your computer and use it in GitHub Desktop.
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/bash | |
# Name: bscript.sh | |
# Author: ben | |
# Date: 2024-05-24 | |
# Description: Generate an executable bash script with path | |
path="$HOME/bin/custom/" | |
echo "zsh script name:" | |
read name | |
echo "path: (default: $path)" | |
read custompath | |
if [[ -n "$custompath" ]]; then | |
path="$custompath" | |
fi | |
cd $path | |
file="${name}.sh" | |
touch $file | |
cat << EOF > $file | |
#!/bin/bash | |
# | |
# Name: $file | |
# Author: $USER | |
# Date: $(date '+%Y-%m-%d') | |
# Description: | |
EOF | |
chmod u+x $file | |
echo "$(pwd)/$file" | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment