-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenScript.sh
More file actions
executable file
·39 lines (29 loc) · 819 Bytes
/
genScript.sh
File metadata and controls
executable file
·39 lines (29 loc) · 819 Bytes
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
#!/bin/bash
# Script-Name : genScript.sh
# Author : Daniel Weise
set -x
# Author of the new script
author="Daniel Weise"
company="Concepts and Training"
email="daniel.weise@conceptsandtrainings.de"
# directory of the script
script_dir=`pwd`
# editor to use
editor=subl
# first argument has to the scriptname
[ -z "$1" ] && exit 1
# file allready exists
[ -f $script_dir/$1 ] && exit 1
# create file
touch $script_dir/$1
# write basics to file
echo "#!/bin/bash" >> $script_dir/$1
echo "" >> $script_dir/$1
echo "# Script-Name : $1" >> $script_dir/$1
echo "# Author : $author" >> $script_dir/$1
echo "# Company : $company " >> $script_dir/$1
echo "# Email : $email" >> $script_dir/$1
# set executable permissions for the user
chmod u+x $script_dir/$1
# start editor and load script
$editor $script_dir/$1