I am executing shell file like this in terminal:
./cherrypicker.sh input.txt
input.txt contains input text.
My purpose is to pass input text directly as command line argument from web interface
I checked cherrypicker.sh file, to get some clue. it has
tools/pos/pos.sh tools/pos $1 > $1.pos 2> /dev/null
If $1 would have been text from input.txt then I could have passes text directly. But when I do echo $1 it give input.txt.
I could not understand what is > indicates here and also 2 and /dev/null
Any explaination would be much appreciable. I checked about .sh file but articles says it's shell file equavalent to .bat file
Cherrypicker.sh
#!/bin/bash
echo "running stanford pos tagger..."
tools/pos/pos.sh tools/pos $1 > $1.pos 2> /dev/null
echo $1.pos
echo "running stanford ner tagger..."
tools/ner/ner.sh tools/ner $1 > $1.ner 2> /dev/null
echo "running charniak parsing..."
java MakeCharniakInput $1
tools/charniak-parser/PARSE/parseIt -l300 tools/charniak-parser/DATA/EN/ $1.charniakIN > $1.charniak
echo "running minipar parsing..."
tools/minipar/pdemo/pdemo -p tools/minipar/data/ < $1 > $1.minipar
echo "detecting mentions..."
java MentionDetection $1
tools/crf++/crf_test -m modelmd $1.crf > $1.pred
java CreateNPSpan $1 $1.pred
# if [[ $1 = "mp" ]]
# then
# echo "creating feature file...."
# java -cp .:edu.mit.jwi.jar CherryPick mp raw.txt
# echo "classifying clusters using $1 model....."
# tools/svmmentionpair/svm_classify raw.txt.mpsvm modelmp raw.txt.mppred
# java MakeCluster raw.txt raw.txt.mppred
# elif [[ ( $1 = "mr" ) || ( $1 = "cr" ) ]]
# then
echo "creating feature file...."
java -cp .:edu.mit.jwi.jar CherryPick cr $1
echo "classifying clusters using cr joint model....."
tools/svmrank/svm_classify $1 modelrank > $1.entities
# else
# echo "cannot classify clusters using *mysterious* model....."
# fi
echo "creating output....."
java MakeResponse $1
cherrypicker.shexpects as input a filename, not some text. As the various programs used in this script also expect a filename and cannot be given some text directly (in particular "java"), you first need to create a file containing your text, then pass it to the script.