Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
#!/bin/bash | ||
|
||
|
||
function main { | ||
# Execute tesseract command, display the output of the generated file and delete it | ||
tesseract $1 /tmp/clitess_out "${@:2}" | ||
cat /tmp/clitess_out* 2> /dev/null | ||
rm /tmp/clitess_out* 2> /dev/null | ||
# Execute tesseract command, display the output of the generated file and delete it | ||
tesseract $1 /tmp/clitess_out "${@:2}" | ||
cat /tmp/clitess_out* 2> /dev/null | ||
rm /tmp/clitess_out* 2> /dev/null | ||
} | ||
|
||
function showHelp { | ||
echo "Tesseract command line tool." | ||
echo "" | ||
echo "Display the output of a Tesseract execution without worry of the output file" | ||
echo "" | ||
echo "Usage:" | ||
echo " clitesseract <imagename> [OPTIONS] [CONFIGURATIONS]" | ||
echo "Tesseract command line tool." | ||
echo "" | ||
echo "Display the output of a Tesseract execution without worry of the output file" | ||
echo "" | ||
echo "Usage:" | ||
echo " clitesseract <imagename> [OPTIONS] [CONFIGURATIONS]" | ||
} | ||
|
||
if [ $1 = "--help" ] || [ $1 = "-h" ]; then | ||
showHelp | ||
showHelp | ||
else | ||
main "$@" | ||
main "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
|
||
if [ ! -f "$1" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then | ||
echo "Usage: randline <filename>" | ||
echo "" | ||
echo "Display a random line of a file" | ||
exit -1 | ||
fi | ||
|
||
sed -n $((RANDOM % $(wc -l "$1" | cut -d ' ' -f 1) + 1))p "$1" |