Hi
Any one pls give me command in vi to replace /opt/usr with /home/reddy/dump .... i tried escaping / with \ bt its not working...
thanks in advance
Hi
Any one pls give me command in vi to replace /opt/usr with /home/reddy/dump .... i tried escaping / with \ bt its not working...
thanks in advance
At the : prompt type
#/opt/usr#/home/reddy/dump#
In vi:
:%s#\/opt\/usr#\/home\/reddy\/dump#g
QED! (quite easily done!)
:%s_/opt/usr_/home/reddy/dump_g
u can use anydelimiter ...since ur string cntains too many slashes, therefore to avoid escaping all the slashes and messy syntex... this 1 'll be the simplest.
Anchal.
@dewets : why u again esacpe the slashes... if u alreadyusing delim as "#".
i dont think its needed...
is there any other reason..... correct me if i m wrong...
Yes, thats correct.
When '#' is used as delimiter no need to use '/' as '\/'
but using '#' when the patten contains '/' adds more readability
better use perl search and replace.