Hi,
It is not entirely clear if you want the output to be just that one line (DIRECTORY = /usr/local/bin) or if the rest of the file needs to be shown as well (unchanged).
Only show specific, edited, line:
Code:
sed -n '/DIRECTORY/s/.*= \(.*\)\/.*/DIRECTORY = \1/p' tmp.txt
# output would be
DIRECTORY = /usr/local/bin
Show all, but change specific line:
Code:
sed '/DIRECTORY/s/.*= \(.*\)\/.*/DIRECTORY = \1/' tmp.txt
# output would be
((hello
(type = file)
DIRECTORY = /usr/local/bin
BTW: Please put your script/data inside
[code] ... [/code] tags it preserves all spacing. If you don't know how:
LQ - BB Code List.
Hope this helps.
EDIT: If the
DIRECTORY = isn't wanted:
Code:
sed -n '/DIRECTORY/s/.*= \(.*\)\/.*/\1/p' tmp.txt
# output would be
/usr/local/bin