October 4th, 2013, 03:06 AM
System command not working. Anything wrong?
I've a perl script where in i've system command used to run a tesseract.exe application. This perl script is run from Red hat linux OS.
System command provided is as below:
system("$te_dir/tesseract $dir/$file $dir/$fle1") == 0 or die "Tesseract failed: $!";
And i get a message as below:
Tesseract failed: No such file or directory at boot.pl line 743.
Can i know what is the problem here?
October 4th, 2013, 03:11 AM
There's a lot of variables in that string, so you should print that before you issue the system command and see if the string contains the command you are expecting.
"$te_dir/tesseract $dir/$file $dir/$fle1"
If it looks correct to you, try running that same statement directly from the command line.
October 4th, 2013, 03:17 AM
Thanks keath. I did print using "print" command. Below is the print output.
/projects/bsrootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract /projects/bsrootfs/androind_nightly_build/BX/Android/caffeine.png /projects/bsrootfs/androind_nightly_build/BX/Android/caffeine
I did ran tesseract.exe from "cmd" window in Windows 7 OS and it works fine. But when i ran from RedHat Linux OS i'm getting the following error:
bash: /projects/bse_blr_rootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract: No such file or directory
If i give app name as "tesseract.exe" instead of "tesseract", below is the message:
bash: /projects/bse_blr_rootfs/androind_nightly_build/BX/Android/tessract_Win/tesseract.exe: cannot execute binary file
October 4th, 2013, 03:28 AM
I do not have the tesseract program installed; but yes, an .exe file usually indicates a Windows only binary.
Tesseract is available for Linux though also:
but you will have to install it and it will not be in the same location as the Windows version. You can not just copy the utility over from a Windows machine.
If the Linux install location is in your system's PATH, you won't have to provide the full directory. You could just issue the 'tesseract' command directly.
October 4th, 2013, 04:00 AM
Thanks. Although this is now not related to perl, i will go ahead and post the results of compilation from linux.
I did compile tesseract.tar.gz file. But i did not find tesseract.exe or just tesseract app in ../bin directory where all other apps were created. What could be the issue?
October 4th, 2013, 08:39 AM
Did you follow the compile instructions on this page?
Easiest to use the package installer for you Linux distribution. But if you did the manual compile, you could have specified where to install.
One thing to try would be to run the command
on the command line and see if it finds for you. If it does, you won't have to specify the path yourself since the system already knows where it is.