-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbash_iterate
executable file
·55 lines (49 loc) · 1.15 KB
/
bash_iterate
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
#!/usr/bin/bash
#
myskills="../aricg.github.io/assets/Pandoc/skills-positions-summary.txt"
while IFS= read -r file; do
# Process each file here
#
# If there is a '.done' file, skip this iteration
if [ -e "${file%.txt}.done" ]; then
echo "Already applied for: $file"
continue
fi
echo "CLASSIFY#####"
#Classify
if [ ! -e "${file%.txt}.yaml" ]; then
gpt --file "$file" \
--output "${file%.txt}.yaml" \
--prompt=5 \
--model-selection=3 \
--confirm-send=y >/dev/null 2>&1
else
echo "Already classified"
fi
#Decide
echo "DECIDE#######"
if [ ! -e "${file%.txt}.ok" ]; then
gpt --file "$myskills" "${file%.txt}.yaml" \
--output "${file%.txt}.ok" \
--prompt=6 \
--model-selection=4 \
--confirm-send=y >/dev/null 2>&1
else
echo "Already decided"
fi
#review
echo "REVIEW#######"
if [ -f "${file%.txt}.ok" ]; then
content=$(<"${file%.txt}.ok")
if [ "$content" = "1" ]; then
echo "this job has been rejected."
echo "# # # # # $file"
else
echo "# Approved, please review #"
echo "# # # $file"
cat "${file%.txt}.ok"
echo "############ ##############"
fi
fi
done \
< <(find jobs -type f -name "*.txt")