Skip to content

Instantly share code, notes, and snippets.

@tonythell
Last active January 30, 2017 02:00
Show Gist options
  • Save tonythell/d3d15dc33e798788f9b2853774574f8b to your computer and use it in GitHub Desktop.
Save tonythell/d3d15dc33e798788f9b2853774574f8b to your computer and use it in GitHub Desktop.
remove and/or replace content with a line using vim.

Remove content from within a line.

Remove the UUID number, which will be replaced later.

KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-360060e80100a82f00530203700000055", SYMLINK+="asm-data001", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-360060e80100a82f00530203700000056", SYMLINK+="asm-data002", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-360060e80100a82f00530203700000057", SYMLINK+="asm-data003", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-360060e80100a82f00530203700000058", SYMLINK+="asm-data004", OWNER="grid", GROUP="oinstall", MODE="0660"

Using the following command.
:%s/3600.\{-}\"/\"/

It will become:

KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-", SYMLINK+="asm-data001", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-", SYMLINK+="asm-data002", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-", SYMLINK+="asm-data003", OWNER="grid", GROUP="oinstall", MODE="0660"
KERNEL=="dm-*", ENV{DM_UUID}=="part1-mpath-", SYMLINK+="asm-data004", OWNER="grid", GROUP="oinstall", MODE="0660"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment