Sponsored Content
Top Forums UNIX for Beginners Questions & Answers By pass a process in a Shell Script on file size Post 303039394 by worky on Thursday 3rd of October 2019 01:39:17 AM
Old 10-03-2019
By pass a process in a Shell Script on file size

I wish to by pass a process if the file is over a certain size?
not sure this makes sense

current bit of the script below

Code:
#if we are bypAssing the OCR
if [ $BYPASS_OCR == "Y" ] ; then
   echo Bypassing HOTFOLDER OCR
   HOT_FOLDER_DIR=$BATCH_POST_OCR_DIR;

potential change below? would this work would I need to declare FILE_SIZE somehow?

Code:
if [ $BYPASS_OCR == "Y" and FILE_SIZE > 1000kb ] ; then
   echo Bypassing HOTFOLDER OCR
   HOT_FOLDER_DIR=$BATCH_POST_OCR_DIR;



Last edited by Neo; 10-03-2019 at 03:29 AM.. Reason: Code Tags Please See YT Video on this: https://youtu.be/4BuPvWJV__k
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass arguments to SQL file passed in shell script?

Hi, I am using SYBASE database. in my script i am connecting to DB via using isql. isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 Replies

2. Shell Programming and Scripting

How to pass tablenames from a file to shell script to execute create statement in DB2

Hi, I am new to Shell Scripting, and I need to create nicknames for 600 tables in db2. I have the file names in a text file and i have to pass these table names to a shell script create nicknames in db2. Can some one please help me in this regard. (1 Reply)
Discussion started by: kamalanaatha
1 Replies

3. Shell Programming and Scripting

shell script for getting the file size

Hi can some one please help me how i can get the output i require: My text file "sample.txt" contains the text like below Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_fedora-lv_root 15G 2.6G 12G 19% /hari Filesystem Size ... (3 Replies)
Discussion started by: harimhkr
3 Replies

4. UNIX for Dummies Questions & Answers

Pass variables from a text file to a shell script

Hi, I have a text file as follows: a.txt ------ STEPS=3 STEP_DURATION=100 INTERVAL=60 I want to use these values in a shell script. How to go about this? (3 Replies)
Discussion started by: akarnya
3 Replies

5. Shell Programming and Scripting

Unable to pass value from .Shell script to .SQL file

Hi All, I am new to shell script. I am trying to pass value from .sh file to .sql file . But I am able to run the .sql file from .sh file with values in sql file. But I am unable to pass the values from .sh file. can some one please help to resolve this. here is my .sh file s1.sh ... (4 Replies)
Discussion started by: reddy298599
4 Replies

6. Shell Programming and Scripting

How to pass the parameter in xml file in UNIX shell script?

Hi, I have an XML file like the following... <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ONDEMAND_JOB VERSION="5.1" LOCALE="en_US"> <IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (2 Replies)
Discussion started by: Debalina Roy
2 Replies

7. Shell Programming and Scripting

How to pass the parameter in xml file in UNIX shell script?

Hi, I have an XML file like the following... <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ONDEMAND_JOB VERSION="5.1" LOCALE="en_US"> <IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (3 Replies)
Discussion started by: Debalina Roy
3 Replies

8. Shell Programming and Scripting

Need help to write to log file whether the shell script call pass fail

I have the below script triggered daily at 330am in the morning, since last 7 days job not writing anything to database. below impala shell calling shell file which has sql , it is extracting data and loads to a flat file txt file. which is going wrong for last 1 week. need help, echo... (2 Replies)
Discussion started by: cplusplus1
2 Replies

9. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies

10. Shell Programming and Scripting

Shell script to report file size, pid and also kill the process

Hi All, Looking for a quick LINUX shell script which can continuously monitors the flle size, report the process which is creating a file greater than certain limit and also kill that process. Can someone please help me on this? (4 Replies)
Discussion started by: vasavimacherla
4 Replies
OCRODJVU(1)							  ocrodjvu manual						       OCRODJVU(1)

NAME
ocrodjvu - OCR for DjVu files SYNOPSIS
ocrodjvu {-o | --save-bundled} output-djvu-file [option...] djvu-file ocrodjvu {-i | --save-indirect} index-djvu-file [option...] djvu-file ocrodjvu --save-script script-file [option...] djvu-file ocrodjvu --in-place [option...] djvu-file ocrodjvu --dry-run [option...] djvu-file ocrodjvu {--version | --help | -h | --list-engines | --list-languages} DESCRIPTION
ocrodjvu is a wrapper for OCR systems that allows you to perform OCR on DjVu files. The following OCR engines are supported: o OCRopus[1] (internally, ocrodjvu calls ocroscript's recognize (or rec-tess) command, so that ultimately Tesseract acts as the OCR backend); o Cuneiform for Linux[2]. o Ocrad[3]. o GOCR[4]. o Stand-alone Tesseract[5]. OPTIONS
OCR engine options -e, --engine=engine-id Use this OCR engine. The default is 'ocropus' (OCRopus). --list-engines Print list of available OCR engines. Options controlling output It is mandatory to use exactly one of the following options: -o, --save-bundled=output-djvu-file Save OCR results as a bundled multi-page document into output-djvu-file. -i, --save-indirect=index-djvu-file Save OCR results as an indirect multi-page document. Use index-djvu-file as the index file name; put the component files into the same directory. The directory must exist and be writable. --save-script=script-file Save a djvused script with OCR results into script-file. --in-place Save OCR results in place. (Use this option to retain compatibility with ocrodjvu < 0.2.) --dry-run Don't change any files, throw OCR results away. Text segmentation options -t lines, --details lines Record location of every line. Don't record locations of particular words or characters. This is the default for OCRopus 0.2. The option is ineffective with stand-alone Tesseract 2.0. -t words, --details=words Record location of every line and every word. Don't record locations of particular characters. This is the default for most OCR engines. This option is ineffective with OCRopus 0.2 and stand-alone Tesseract 2.0. -t chars, --details=chars Record location of every line, every word and every character. This option is ineffective with OCRopus 0.2 and stand-alone Tesseract 2.0. --word-segmentation=simple Consider each non-empty sequence of non-whitespace characters a single word. This is the default, despite being linguistically incorrect. --word-segmentation=uax29 Use the Unicode Text Segmentation[6] algorithm to break lines into words. This option breaks assumptions of some DjVu tools that words are separated by spaces, and therefore it is not recommended. Other options --clear-text Remove existing hidden text if present in the pages not selected for OCR. (Use this option to retain compatibility with ocrodjvu < 0.2.) --ocr-only Don't save pages that were not processed. -l, --language=language-id Set recognition language. language-id is typically an ISO 639-2/T three-letter code. For OCRopus, the default is 'eng' (English), unless the tesslanguage environment variable is set. For other OCR engines, the default is always 'eng'. --list-languages Print list of available languages for the currently selected OCR engine. --render=mask Render only masks of page images. This is the default. --render=foreground Render only foreground layers of page images. --render=all Render all layers of page images. This option is necessary to OCR DjVu files with invalid foreground/background separation. -p, --pages=page-range Specifies pages to process. page-range is a comma-separated list of sub-ranges. Each sub-range is either a single page (e.g. 17) or a contiguous range of pages (e.g. 37-42). Pages are numbered from 1. The default is to process all pages. -j, --jobs=n Start up to n OCR processes. --version Output version information and exit. -h, --help Display help and exit. Advanced options -D, --debug To ease debugging, don't delete intermediate files. -X key=value This option allow to control some details of how ocrodjvu operates. --on-error=abort Stop program execution when exception situation (e.g., malformed output from the OCR engine, internal ocrodjvu error, etc.) occurs. This is the default. --on-error=resume Attempt to recover from exceptional situations. This option is strongly discouraged. --html5 Use a HTML5 parser[7], which is more robust but slower than the default parser. ENVIRONMENT
The following environment variables affects ocrodjvu: tesslanguage Recognition language for Tesseract. (Use this variable is deprecated in favor of the --language option.) TMPDIR ocrodjvu makes heavy use of temporary files. It will store them in a directory specified by this variable. The default is /tmp. BUGS
Tesseract 3.00 is affected by a bug [8] making it produce invalid hOCR output in certain circumstances. ocrodjvu does not try recover form this fault (which couldn't be done reliably anyway) unless you pass the -X fix-html=1 option. When using Tesseract >= 3.00, extracting bounding boxes of particular characters (which happens when either --details=chars or --word-segmentation=uax29) is inefficient. This due to limitations of Tesseract command line interface. SEE ALSO
djvu(1), ocroscript(1), tesseract(1), cuneiform(1), ocrad(1), gocr(1) AUTHOR
Jakub Wilk <jwilk@jwilk.net> Author. NOTES
1. OCRopus http://ocropus.googlecode.com/ 2. Cuneiform for Linux http://launchpad.net/cuneiform-linux 3. Ocrad http://www.gnu.org/software/ocrad/ 4. GOCR http://jocr.sourceforge.net/ 5. Tesseract http://code.google.com/p/tesseract-ocr/ 6. Unicode Text Segmentation http://unicode.org/reports/tr29/ 7. HTML5 parser http://www.whatwg.org/specs/web-apps/current-work/#html-parser 8. http://code.google.com/p/tesseract-ocr/issues/detail?id=376 ocrodjvu 0.7.9 03/10/2012 OCRODJVU(1)
All times are GMT -4. The time now is 12:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy