![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Emergency UNIX and Linux Support !! Help Me!! Post your urgent questions here for highest visibility. Posting a new thread to this forum requires Bits. We monitor this forum to help people with emergencies, but we do not guarantee response time or answers. This forum is "best effort" only. Members who reply to posts here receive a bonus of 1000 Bits per reply. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search for string in a file and extract another string to a variable | daikeyang | Shell Programming and Scripting | 6 | 03-20-2009 08:45 PM |
| How to search a string in a file. | prathap | UNIX for Dummies Questions & Answers | 1 | 07-17-2007 03:41 AM |
| String search in log file | sliver | Shell Programming and Scripting | 1 | 07-12-2006 08:09 AM |
| appending string to text file based on search string | malaymaru | Shell Programming and Scripting | 1 | 06-09-2006 09:53 AM |
| please help me to search string in a file ...... | swamymns | Shell Programming and Scripting | 2 | 02-01-2006 12:20 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
||||
|
String search and generating file
Hi Gurus,
I have a requirement as below I have text file a.txt which contains Code:
hi hello process update status Output for file Ok to Proceed no issues good data arrangement "OK to Proceed" and if it is available need to generate an indicator file called "Go.txt" IF else no file should not be generated. Here one more thing to be considered is, file also contains "Not Ok to Proceed" sometimes if the process is not gone thru well. Basically i need to generate an indicator file, if the process is OK by searching "Ok to Proceed" string or else not generating the file if it contains "Not ok to Proceed" I am trying following code but not succesfull upto now Code:
#!/bin/ksh DFT_VALUE='OK to Proceed' ACTUAL_VALUE=`egrep 'OK to Proceed' respectivefolder/a.txt` if [$DFT_VALUE = $ACTUAL_VALUE] then touch a.txt else exit fi Here my problem is how to get only the string from the file to comapre with the variable. Any suggestions or code will be appreciated Thanks in advance, San Thanks in Advance Sandeep Last edited by Franklin52; 10-02-2009 at 04:24 AM.. Reason: Please use code tags! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|