Operating System - HP-UX
1755130 Members
3023 Online
108830 Solutions
New Discussion юеВ

remove /dev/dsk using sed in a file

 
SOLVED
Go to solution
Mike_305
Super Advisor

remove /dev/dsk using sed in a file

Hello,

I have a file with all the disk, stating with /dev/dsk/c1r2d3 and so on.

How can I remove /dev/dsk/ and just keep c1t2d3 in the file.

Appreciate your help.

Regards,

Mp
If there is problem then don't think as problem, think as opportunity.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: remove /dev/dsk using sed in a file

Hi:

# sed -e 's/\/dev\/dsk\///g' file > file.new

Regards!

...JRF...
Mike_305
Super Advisor

Re: remove /dev/dsk using sed in a file

Hello,

Thanks James.

Appreciate your help.

Regards,

MP
If there is problem then don't think as problem, think as opportunity.
Steven Schweda
Honored Contributor

Re: remove /dev/dsk using sed in a file

Nothing magic about "/" here. If something
else would be more convenient, then use it
instead.

$ echo '/dev/dsk/c1r2d3' | sed -e 's|/dev/dsk/||'
c1r2d3