![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file searching... | Kaminski | Shell Programming and Scripting | 1 | 02-02-2008 07:23 AM |
| which is best searching option | dbsurf | Shell Programming and Scripting | 3 | 01-27-2008 08:33 PM |
| Searching in VI | andyblaylock | UNIX for Dummies Questions & Answers | 1 | 11-28-2007 08:32 PM |
| searching searching | tony3101 | Shell Programming and Scripting | 3 | 06-04-2004 12:50 PM |
| directory searching | st00pid_llama | Shell Programming and Scripting | 2 | 05-10-2004 08:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
searching for {
Hello,
I am having a hard time trying to do the following: I have a file that looks like this: 0 CacheMaxConn 4 64 0 RMThread 16 3423423 7 DataSource 0 /hello/sas/ses 0 {94545B4-E343-1410-81E4-08000000} 3 DDBE 3 Source 9 dfskf if the second part of the line in the text file starts with "{" I want to ignore it. any help would be appreciated |
|
||||
|
By "2nd part part of the line", I assume you mean the 2nd field. As you process each record and the relevant fields, the real issue is the construction of a suitable selection that determines whether the first character is a "{".
Personally, I would want to check for a data value that is surrounded by "{" and "}" if that is the definitive trigger for data that needs to be ignored (as in the example you provided). Assuming the 2nd field is in a variable named ${F2} and using the ksh: if [[ ${F2} = {*} ]] then may work (I haven't tried it...) Alternatively, for more complex comparisons, you may want to try regular expression through egrep and check the return code. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|