-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaeaclean
More file actions
executable file
·37 lines (31 loc) · 937 Bytes
/
aeaclean
File metadata and controls
executable file
·37 lines (31 loc) · 937 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
#!/bin/bash
force=FALSE
if [[ "$1" == "force" ]]
then
force=TRUE
shift
fi
actionitems=$(grep -n '\-\-action items go here\-\-' REPLICATION.md|awk -F: '{ print $1}')
if [[ -z $actionitems && $force == FALSE ]]
then
echo "The report does not contain a line with "
echo "----action items go here----"
else
echo "'action items' found at line $actionitems ."
sed -i "${actionitems}d" REPLICATION.md
[[ $? = 0 ]] && echo "Removed." || echo "Something failed."
fi
instructions=$(grep -cE "^> INSTRUCTIONS" REPLICATION.md)
if [[ $instructions == 0 && $force == FALSE ]]
then
echo "The report does not contain lines with "
echo "> INSTRUCTIONS"
exit 2
else
for line in $(grep -nE "^> INSTRUCTIONS" REPLICATION.md | awk -F: ' { print $1 } ')
do
echo "Instruction found at line $line ."
sed -i "${line}d" REPLICATION.md
[[ $? = 0 ]] && echo "Removed." || echo "Something failed."
done
fi