script to generate BASH scripts

I create scripts on a day to day basis, and I eventually got bored of manually creating scripts from initial phase everytime, hence this master of scripts.

#!/bin/bash
# BASH script to generate BASH scripts
# Created by Mpho Mphego
 
echo "What do you want to call your BASH script?"
read RESPONSE
 
echo "#!/bin/bash" | tee ~/tmp/$RESPONSE.sh
echo "# Filename:$RESPONSE.sh" | tee -a ~/tmp/$RESPONSE.sh
echo "# The purpose of this script is to ..." | tee -a ~/tmp/$RESPONSE.sh
echo "# Script written by Mpho Mphego Marion Island SANSA Engineer 2014-2015" | tee -a ~/tmp/$RESPONSE.sh
 
sudo chmod +x ~/tmp/$RESPONSE.sh
 
sudo ln -s ~/tmp/$RESPONSE.sh ~/bin/$RESPONSE.sh
sudo chmod +x ~/bin/$RESPONSE.sh
 
gedit ~/tmp/$RESPONSE.sh
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s