forked from adityaarakeri/super-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_script_generator
More file actions
41 lines (32 loc) · 1.5 KB
/
bash_script_generator
File metadata and controls
41 lines (32 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
###################################################################
#SCRIPT NAME: bash_script_generator.sh
#DESCRIPTION: This script automatically creates a bash script and
# write header for the script.
#USAGE: bash bash_script_generator.sh NEW_SCRIPT_NAME AUTHOR EMAIL
# You can also set an alias named 'mksc' for the script
# to use it easily. For this purpose edit and add the
# following line to your basrc/zshrc:
# alias mksc='bash /PATH/TO/SCRIPT/bash_script_generator.sh AUTHOR EMAIL'
#REQUIREMENTS: vim
#AUTHOR: Isin Altinkaya
#EMAIL: isinaltinkaya@gmail.com
###################################################################
# the desired name of the new bash script
SCRIPT_ID=$1
AUTHOR=$2
EMAIL=$3
SCRIPT=${SCRIPT_ID}.sh
touch $SCRIPT
cat > "$SCRIPT" << EOF
#!/bin/bash
###################################################################
#SCRIPT NAME: ${SCRIPT}
#DESCRIPTION:
#USAGE: bash ${SCRIPT}
#REQUIREMENTS:
#AUTHOR: ${AUTHOR}
#EMAIL: ${EMAIL}
###################################################################
EOF
vim $SCRIPT -c ":12"