Jump to content


Photo
- - - - -

ischk and stdout


8 replies to this topic

#1 mikelandl

mikelandl

    Expert

  • Members
  • PipPipPipPip
  • 101 posts

Posted 03 October 2005 - 02:27 PM

Hi all,

I'm writing a small bash script to run ischk against all .pro files on a linux system and report back any issues with any files. I created a .pro file (bad.pro) and purposely corrupted the file. When I run ischk on the cli against the file I get the following output:

ischk ------- PRO-IV ® Verify internal structure of PRO-ISAM files
Copyright © 1999 PROIV Technology, Inc.
All rights reserved. Unauthorised use strictly prohibited.

PRO-ISAM Version: 13.05.5 Date: Jan 16, 2004

bad.pro: 101 - Corrupted isam file.
Enter to continue...


Great. So my script is setup to redirect output from ischk to a temp file and look for the "101 - Corrupted isam file." The thing is, everything is written to the temp file "except" the "101 - Corrupted isam file." line. Any suggestions? Thanks in advance.

#2 Steven Torrance

Steven Torrance

    Advanced

  • Members
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:Edinburgh, United Kingdom

Posted 03 October 2005 - 02:40 PM

Hi,

There is the "Enter to continue...."

If you aren't sending a return to the ischk, it wont have written that part of the file (and actually still be running).

In UNIX we would do
ischk -n file.pro

(answer no to the question of "Repair file?")
You could also do
ischk -y file.pro

HTH

Steven

#3 mikelandl

mikelandl

    Expert

  • Members
  • PipPipPipPip
  • 101 posts

Posted 03 October 2005 - 02:48 PM

Thanks for the quick reply Steven. Should have thought of that. I've updated my script to include the -n and now the txt files contains the following:

ischk ------- PRO-IV ® Verify internal structure of PRO-ISAM files
Copyright © 1999 PROIV Technology, Inc.
All rights reserved. Unauthorised use strictly prohibited.

PRO-ISAM Version: 13.05.5 Date: Jan 16, 2004


So we got rid of the "Enter to continue..." line but "bad.pro: 101 - Corrupted isam file." line still isn't showing up. B)

#4 Steven Torrance

Steven Torrance

    Advanced

  • Members
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:Edinburgh, United Kingdom

Posted 03 October 2005 - 03:03 PM

Hmmm....
Only thing I can think of is that the error message is not going to the file and is going to standard error device (normally the screen). (If you run the script, do you still get the error on the screen)

In Unix we would use
ischk -n file.pro >>outfile.txt 2>>errorout.txt

Not sure if this all works in Linux - give it a try. The "2>>" sends the error text to that file.

We have a routine in Unix that does exactly what you are trying to do - but we do get all the error messages without the 2>> added - at least I hope we do! (Senses long hours trying to explain why the business have lost the last 2 years of data!)

Steven

#5 mikelandl

mikelandl

    Expert

  • Members
  • PipPipPipPip
  • 101 posts

Posted 03 October 2005 - 03:10 PM

Thanks a million Steven. That was exactly it. Can't believe I didn't think of that. Can I blame it on Monday? B)

#6 Steven Torrance

Steven Torrance

    Advanced

  • Members
  • PipPipPip
  • 52 posts
  • Gender:Male
  • Location:Edinburgh, United Kingdom

Posted 03 October 2005 - 03:12 PM

Glad to help!
I tend to blame things like that on being in a work environment! B)
Happens every day of the week!

Steven

#7 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 03 October 2005 - 06:29 PM

And if you wanted the stderr stuff to go to the same stream you've redirected stdout, remember you can just use 2>&1..

ischk -n file.pro >>outfile.txt 2>&1

#8 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 07 October 2005 - 02:55 AM

ISCHK will seldom detect a corrupt pro-isam file and if used to repair a corrupt file will more often than not turn a corrupt file into a much more corrupt file.

You might want to look at using the 'proscan' utility (FREE) which comes packaged along with a demo version of NetAware Technologies 'protrack' software system (www.net-aware.com). This free software is designed to perform a very complex analysis scan of a user-created list of pro-isam files and post a summary to a user specified text result file. This will detect errors far beyond what ischk can detect.

Certain files might show corrupt under proscan when they might actually be ok, such as intentional non-alpha characters in key fields, etc., but you can generally recognize and ignore these files after a pass or two.

#9 Guest_Easy Fix Warrior_*

Guest_Easy Fix Warrior_*
  • Guests

Posted 11 October 2005 - 04:52 PM

Is it any wonder the file is corrupt when its name is defined as "bad.pro"??

Using such an irresponsible naming convention is just asking for trouble...

Simply rename the file to good.pro and delete your now unnecessary script. :( :lol: :lol:

Hope this helps.

E.F. Warrior



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users