![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| "sed" to check file size & echo " " to destination file | jockey007 | Shell Programming and Scripting | 6 | 11-13-2007 06:00 PM |
| Need info:"talk,write and wall" | mr.anilbabu | UNIX for Dummies Questions & Answers | 1 | 07-23-2006 01:27 AM |
| how do I dump "info ls" to a file? | james hanley | UNIX for Dummies Questions & Answers | 4 | 07-05-2006 06:36 AM |
| Filtering/Finding a "Fortune" message | oldtrash | Shell Programming and Scripting | 4 | 05-13-2005 04:16 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
Quote:
Hey thanks Buddy !! ..For such a descriptive reply !! I am using AIX5.2, where i can use awk frequently. I have no idea abt gawk, mawk, nawk !! ANyways !!...any other shortcut to filter the string value between () ?? Thanks !! |
| Forum Sponsor | ||
|
|
|
#9
|
||||
|
||||
|
With bash, zsh, ksh93:
Code:
cut -d\) -f1 <(cut -d\( -f2 yourfile) |
|
#10
|
||||
|
||||
|
Can you use sed?
Code:
sed 's/[^(]*(\([^)]*\)).*/\1/' yourfile |
|
#11
|
||||
|
||||
|
Or even:
Code:
while IFS='(' read a b;do echo "${b%%)*}";done<yourfile
|
||||
| Google The UNIX and Linux Forums |