-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathformat_script.sh
58 lines (45 loc) · 1.16 KB
/
format_script.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Script Name : export_users.ksh
# Author : Craig Richards
# Created : 08-November-2012
# Last Modified :
# Version : 1.0
# Modifications :
# Description : Get a list of the Oracle schemas then export them
#################################
# Start of procedures/functions #
#################################
funct_check_params() # Function to check the amount of parameters being passed
{
if [ ${NARG} -ne 1 ]; then
echo "Not enough parameters passed"
echo "call : $0 script name"
exit 1
fi
}
funct_toUpper() # Function to convert to Uppercase
{
echo $1 | tr "[:lower:]" "[:upper:]"
}
funct_format() # Function to carry out the formatting
{
for OLD in `cat $my_config/words.txt`;
do
new=`echo $OLD | tr "[:lower:]" "[:upper:]"`
sed -e 's/\<'$OLD'\>/'$new'/g' "$FILENAME" > output.sql && cat output.sql > "$FILENAME"
done
rm output.sql
echo -e "\n[+] $FILENAME has been formatted [+]\n"
}
################
# Main Program #
################
# Variable Settings
NARG=$#
my_config='/cygdrive/c/users/crichards/Dropbox/config'
FILENAME=$1
{
funct_check_params
funct_format
}
## End of Script