Skip to content

Quick and easy creation of new Bash scripts with executable permissions and a shebang line.

Notifications You must be signed in to change notification settings

0Reab/Bash-script-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

Bash-script-creator

This Bash script is designed to quickly and efficiently create new Bash scripts with executable permissions and a shebang line.
Opens the new script in a text editor of your choice after the file creation for a quick start.

Features

  • Adds the Shebang Line.
  • Set executable permission for your user.
  • Adds a file extension to the filename.
  • Prevents overwriting existing files.
  • Open the script in your favorite text editor.

Usage

./mkscript.sh <script_name>
./mkscript.sh <script_name> py

(add "py" arg for python script, else it will default to .sh bash script file extension).

Efficient Usage

Put this script in your PATH, for eg. /usr/local/bin and remove '.sh' extension so you can run this without './'
cp mkscript.sh mkscript
sudo mv mkscript /usr/local/bin

Example

Alt Text

./mkscript.sh my_script This will create a file named my_script.sh, make it executable, add a shebang line, and open it in vim.

Installation

Clone the repository to your local machine:
git clone https://github.com/0Reab/bash-script-creator.git

Navigate to the script directory:
cd bash-script-creator

Make the script executable:
chmod +x mkscript.sh

Notes

Customize the script to use your text editor.
Use your hardcoded absolute paths to binaries and else, for better security.

About

Quick and easy creation of new Bash scripts with executable permissions and a shebang line.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages