35e09e8d71f388698aff3f406c9e8c60ef398f1d
4 INPUT_FILE
="/home/baltakatei/Sync/kodawkuori-07/2020/reference-PERS/lojban/20190626..gismu_english_order.txt"
5 if [ ! -f "$INPUT_FILE" ]; then echo "ERROR: gismu list text file not found." 2>&1 ; exit 1; fi
8 # usage: randGismuDef [gismu.txt file]
9 # output: <<gismu>>,<<def>>
11 randLineNum
=$
(shuf
-n1 -i2-$
(cat "$FILE" |
wc -l)) # Generate random line number of FILE
12 # Output random 2nd space-delimted field (gismu) from file
13 #echo $(cat "$FILE" | cut -d' ' -f2-3 | head -n"$randLineNum" | tail -n1 )
14 echo $
(cat "$FILE" |
awk '{print $1 "," $3}' |
head -n"$randLineNum" |
tail -n1 )
18 # usage: randGismu [gismu.txt file]
21 randLineNum
=$
(shuf
-n1 -i2-$
(cat "$FILE" |
wc -l)) # Generate random line number of FILE
22 # Output random 2nd space-delimted field (gismu) from file
23 echo $
(cat "$FILE" |
awk '{print $1}' |
head -n"$randLineNum" |
tail -n1 )
26 GISMU1
=$
(randGismu
"$INPUT_FILE")
27 GISMU2
=$
(randGismu
"$INPUT_FILE")
28 GISMU3
=$
(randGismu
"$INPUT_FILE")
30 #RAW1=$(randGismuDef "$INPUT_FILE")
31 #RAW2=$(randGismuDef "$INPUT_FILE")
32 #RAW3=$(randGismuDef "$INPUT_FILE")
34 #GISMU1=$(echo "$RAW1" | cut -d',' -f1)
35 #GISMU2=$(echo "$RAW2" | cut -d',' -f1)
36 #GISMU3=$(echo "$RAW3" | cut -d',' -f1)
38 #DEF1=$(echo "$RAW1" | cut -d',' -f2)
39 #DEF2=$(echo "$RAW2" | cut -d',' -f2)
40 #DEF3=$(echo "$RAW3" | cut -d',' -f2)
42 echo "$GISMU1 $GISMU2 $GISMU3"
43 #echo "$DEF1 $DEF2 $DEF3"
45 if command -v jbofihe
1>/dev
/null
2>&1; then
46 echo "$GISMU1" | jbofihe
-x
47 echo "$GISMU2" | jbofihe
-x
48 echo "$GISMU3" | jbofihe
-x
50 echo "ERROR: jbofihe command not available." 2>&1;
53 if command -v jvocuhadju
1>/dev
/null
2>&1; then
54 jvocuhadju
"$GISMU1" "$GISMU2" "$GISMU3";
56 echo "ERROR: jvocuhadju command not available." 2>&1;