|
@ -2,26 +2,50 @@ trap 'echo "Interrupted"; |
|
|
rm main; |
|
|
rm main; |
|
|
cp employeeLogin.c.bak employeeLogin.c; |
|
|
cp employeeLogin.c.bak employeeLogin.c; |
|
|
cp mainMenu.c.bak mainMenu.c; |
|
|
cp mainMenu.c.bak mainMenu.c; |
|
|
|
|
|
cp createEmployeeAccount.c.bak createEmployeeAccount.c; |
|
|
rm employeeLogin.c.bak; |
|
|
rm employeeLogin.c.bak; |
|
|
rm mainMenu.c.bak; |
|
|
rm mainMenu.c.bak; |
|
|
|
|
|
rm createEmployeeAccount.c.bak; |
|
|
cd ..; |
|
|
cd ..; |
|
|
rm -r build; exit' SIGINT |
|
|
rm -r build; exit' SIGINT |
|
|
clear |
|
|
clear |
|
|
ceedling test:all |
|
|
ceedling test:all |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd src/ |
|
|
cd src/ |
|
|
cp employeeLogin.c employeeLogin.c.bak |
|
|
|
|
|
cp mainMenu.c mainMenu.c.bak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sed '/John Doe/,$d' employeeList.txt > temp.txt |
|
|
|
|
|
mv temp.txt employeeList.txt |
|
|
|
|
|
# backup files |
|
|
|
|
|
for file in employeeLogin.c mainMenu.c createEmployeeAccount.c; do |
|
|
|
|
|
cp "$file" "$file.bak" |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# replace .c with .h in respective files |
|
|
sed -i 's/employeeLogin.c/employeeLogin.h/g' mainMenu.c |
|
|
sed -i 's/employeeLogin.c/employeeLogin.h/g' mainMenu.c |
|
|
sed -i 's/showGeneralInfoEmployee.c/showGeneralInfoEmployee.h/g' employeeLogin.c |
|
|
sed -i 's/showGeneralInfoEmployee.c/showGeneralInfoEmployee.h/g' employeeLogin.c |
|
|
sed -i 's/mainMenu.c/mainMenu.h/g' employeeLogin.c |
|
|
sed -i 's/mainMenu.c/mainMenu.h/g' employeeLogin.c |
|
|
sed -i 's/src\///g' employeeLogin.c |
|
|
|
|
|
gcc main.c mainMenu.c employeeLogin.c showGeneralInfoEmployee.c -o main |
|
|
|
|
|
|
|
|
sed -i 's/employeeLogin.c/employeeLogin.h/g' createEmployeeAccount.c |
|
|
|
|
|
|
|
|
|
|
|
# remove 'src/' |
|
|
|
|
|
for file in employeeLogin.c createEmployeeAccount.c; do |
|
|
|
|
|
sed -i 's/src\///g' "$file" |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# compile and run program |
|
|
|
|
|
gcc main.c mainMenu.c employeeLogin.c showGeneralInfoEmployee.c createEmployeeAccount.c -o main |
|
|
./main |
|
|
./main |
|
|
rm main |
|
|
rm main |
|
|
cp employeeLogin.c.bak employeeLogin.c |
|
|
|
|
|
cp mainMenu.c.bak mainMenu.c |
|
|
|
|
|
rm employeeLogin.c.bak |
|
|
|
|
|
rm mainMenu.c.bak |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# restore backups |
|
|
|
|
|
for file in employeeLogin.c mainMenu.c createEmployeeAccount.c; do |
|
|
|
|
|
cp "$file.bak" "$file" |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
# remove backups |
|
|
|
|
|
for file in employeeLogin.c.bak mainMenu.c.bak createEmployeeAccount.c.bak; do |
|
|
|
|
|
rm "$file" |
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
cd .. |
|
|
cd .. |
|
|
rm -r build/ |
|
|
rm -r build/ |