Skip to content

Instantly share code, notes, and snippets.

@newbenhd
Created May 24, 2024 23:32
Show Gist options
  • Save newbenhd/44426c10100f145c751c87a6f80df192 to your computer and use it in GitHub Desktop.
Save newbenhd/44426c10100f145c751c87a6f80df192 to your computer and use it in GitHub Desktop.
#!/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