-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo-all-rev
executable file
·42 lines (38 loc) · 1.55 KB
/
do-all-rev
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
#!/bin/bash
#Article_Dir=/home/jsae/Outputs/independence/word-sources/articles
#Article_Dir=/home/jsae/2018/outputs/organizations/2020-orgfinder/cache/good
#Article_Dir=/home/jsae/2018/outputs/organizations/2020-orgfinder/cache/good/first
Article_Dir=/home/jsae/2018/outputs/organizations/2020-orgfinder/cache
#Output_Dir=/home/jsae/Outputs/independence/word-sources/uncommon
#Output_Dir=/home/jsae/2018/outputs/organizations/2020-orgfinder/good/keywords
Output_Dir=/home/jsae/2018/outputs/organizations/2020-orgfinder/examine
Script_Dir=/home/jsae/Outputs/git/stack-agents-prv
Script_Name=Uncommon.php
#FilesSet=*.txt
#FilesSet=*.md
FilesSet=*.html
cd $Article_Dir
for f in $FilesSet
do
echo "Processing file $f:"
#echo $Article_Dir
#echo $Output_Dir
#echo $Script_Dir
#echo $Script_Name
# insert new article file name into PHP script
# old="$Article_Dir"
# new="$Article_Dir/$f"
# phpScript="$Script_Dir/$Script_Name"
# escOld=$(sed 's/[^^\\]/[&]/g; s/\^/\\^/g; s/\\/\\\\/g' <<< "$old")
# escNew=$(sed 's/[&/\]/\\&/g' <<< "$new")
# sed -i "/$escOld/c\\\$file = \"$escNew\";" "$phpScript"
# cp -vf $phpScript /var/www/stackr.test/vendor/nrwtaylor/stack-agent-thing/agents/.
# run agent PHP
echo "Saving results to $Output_Dir/"$f".out"
php /var/www/stackr.test/agent uncommon $Article_Dir/"$f" > $Output_Dir/"$f".out
# remove error messages
# sed -i -e "/Warning seen/d" -e "/Notice/d" -e "/APACHE/d" -e"s/Found uncommon words://" -e "s/ /\n/g" $Output_Dir/"$f".out
done
cd $Output_Dir
echo $PWD
rename "s/ //g" *.out