Search Results

Search: Posts Made By: Dpu
2,289
Posted By alister
sed -n...
sed -n 's/^DBconnection.*SERVICE_NAME=\([^)]*\).*/\1/p' filename

Regards,
Alister
2,289
Posted By bakunin
First off, "grep" isn't the right tool: "grep"...
First off, "grep" isn't the right tool: "grep" will always return whole lines, but not parts of it. You need "sed" (or "awk" or some other text filter) to do what you want.

First, lets describe...
2,289
Posted By ctsgnb
sed '/^DBconn/!d;s/.*SERVICE_NAME=//;s/).*//'...
sed '/^DBconn/!d;s/.*SERVICE_NAME=//;s/).*//' infile


awk '/^DBconn/{match($0,"SERVICE_NAME=[^)]*[)]"); print substr($0,(RSTART+13),(RLENGTH-14))}'

use nawk if on Solaris
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy