Computing.Net > Forums > Unix > Kornshell script help is needed

Kornshell script help is needed

Reply to Message Icon

Original Message
Name: foad
Date: March 14, 2003 at 00:00:30 Pacific
Subject: Kornshell script help is needed
OS: WIN 2000
CPU/Ram: 523 M
Comment:

I need to write a script with kornshell which does this:

THE SCRIPT GOES THROUGH A CERTAIN FILE AND SEARCHES FOR ANY ROW THAT CONTAINS THIS SENTENCE: "File not found". AFTER FINDING ALL THOSE ROWS, IT WILL REDIRECT THOSE ROWS TO ANOTHER FILE.

I preciate any kind of help.
Thanka in advance,
Foad


Report Offensive Message For Removal


Response Number 1
Name: WilliamRobertson
Date: March 14, 2003 at 00:49:20 Pacific
Reply: (edit)

grep 'File not found' sourcefile > targetfile

Or to append to targetfile instead of overwriting it:
grep 'File not found' sourcefile >> targetfile


Report Offensive Follow Up For Removal

Response Number 2
Name: Emilio Frini
Date: March 14, 2003 at 06:58:56 Pacific
Reply: (edit)

I need to create a kornshell script that
include ftp commands .
I already created this shell but I'm not
able to check if the ftp finish well or
not .

Any suggestion will be very apreciates .

Thanks and Regards
Emilio Frini
emifrini@tin.it


Report Offensive Follow Up For Removal

Response Number 3
Name: David Perry
Date: March 20, 2003 at 05:00:58 Pacific
Reply: (edit)

You need a shell ( like expect ) that can read a return code from the ftp daemon.

110 Restart marker reply. MARK yyyy=mmmm where yyyy is a user process data stream marker, and mmmm is ftpd's equivalent marker

120 Service ready in nnn minutes

200 Command okay

211 System status, or system help reply

212 Directory status

230 User logged in, proceed

250 Requested file action okay, completed

331 User name okay, need password

350 Requested file action pending further information

425 Cannot open data connection

451 Requested action aborted: local error in processing

500 Syntax error, command unrecognized or command line too long

530 Not logged in

550 Requested action not taken; file unavailable, not found, no access


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Kornshell script help is needed

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge