I have a program that reads two words in command line:
#!/bin/bash
if [[ "$1" != "" && "$2" != "" ]]; then
java -Xmx1024m -cp lib/*:esalib.jar clldsystem.esa.ESAAnalyzer "$1" "$2"
else
java -Xmx1024m -cp lib/*:esalib.jar clldsystem.esa.ESAAnalyzer
fi
I replaced this code to read from a file line by line, this is an example of the file that i must read:
vehicle car
computer program
volley ball
the code read each line and affect each word to a variable, the problem is in the splitting process of each line so it affec to $var1 and $var2 the same word
#!/bin/bash
while read ligne
do
var1=$(echo $ligne | cut -f1 -d-)
var2=$(echo $ligne | cut -f2 -d-)
if [[ "$var1" != "" && "$var2" != "" ]]; then
java -Xmx1024m -cp lib/*:esalib.jar clldsystem.esa.ESAAnalyzer "$var1" "$var2"
else
java -Xmx1024m -cp lib/*:esalib.jar clldsystem.esa.ESAAnalyzer
fi
done < mm.txt
but the new code don't give results