![]() |
|
|
|
|
|||||||
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. Shell Script Page. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| retrieved multiple lines on multiple places in a file | dala | Shell Programming and Scripting | 8 | 03-14-2008 11:28 AM |
| error: initializer expression list treated as compound expression | arunchaudhary19 | High Level Programming | 12 | 11-16-2007 02:44 AM |
| Expression for Finding Multiple Directories..?? | meskue | Shell Programming and Scripting | 3 | 07-10-2006 12:04 PM |
| How to choose Multiple process or Multiple threads? | ashleykumar | IP Networking | 0 | 04-10-2006 03:30 AM |
| Regular Expression + Aritmetical Expression | Z0mby | Shell Programming and Scripting | 2 | 05-21-2002 07:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
need help on multiple expression
this is the content of the file:
Quote:
|
| Forum Sponsor | ||
|
|
|
|||
|
If you are on Solaris or HP-UX, did you try looking for nawk or XPG4 awk?
The grep command above should work, as such. The dash between = and ( in the command you tried seems misplaced; does it help if you take it out? How exactly is the result wrong? |
|
|||
|
Quote:
my dashes are not at the first position, in fact it's a certain distance away from the 1st position of the line, having some spaces in between when i do that command above, it still doesn't remove the dashes, that's all |
|
|||
|
That command should remove any line which contains an equals sign, or an opening parenthesis; the dash you put between also causes it to remove all lines which contain a character whose ASCII code falls between those two, in theory; however, ( comes before = in ASCII so I guess it doesn't really change anything (but could also be the reason you're not getting it to work). Take out the dash and try again? Or move it first or last in the class, like
Code:
grep -v '[-=(]' file Last edited by era; 05-15-2008 at 11:48 PM. Reason: Or move to beginning or end of class |
|
|||
|
thanks era, your method works however.
erm, i got another question though Quote:
However, after the data is done showing, the next line will always be a empty space (or "\n" if what you guys call it) so how do I extract those data and ignore the 'x254'? |
| Tags |
| solaris |
| Thread Tools | |
| Display Modes | |
|
|