Tag Archives: data

sed to play with data or parsing your text

To select all the lines starting from STARTING_PATTERN up to  blank line ^$ and then delete those lines.

# sed ‘/STARTING_PATTERN/,/^$/d’ filename

To edit files in place, use -i option.

# sed -i ‘/STARTING_PATTER/,/^$/d’ filename

Insert multiple lines into a file after specified pattern.

# sed ‘/cdef/r add.txt’ input.txt

# sed ‘/cdef/r add.txt’ input.txt

input.txt:
abcd
accd
cdef
line
web
add.txt:
line1
line2
line3
line4
Output :
abcd
accd
cdef
line1
line2
line3
line4
line
web

If you want to apply the changes in input.txt file. Then, use -i with sed.

# sed -i ‘/cdef/r add.txt’ input.txt

If you want to use a regex as an expression you have to use the -E tag with sed.

# sed -E ‘/RegexPattern/r add.txt’ input.txt

How to Halt the VNX Data Movers ?

The following procedure explains how to perform an orderly, timed, or immediate
halt of a network server’s Data Mover or blade. This procedure applies to all VNX
unified and VNX for file systems.

Note: A Data Mover for a VNX for file server is also called a blade. There is no functional
difference between a Data Mover and a blade. They both serve the same purpose in a VNX
for file server.

To immediately halt a Data Mover or blade, use this command syntax:

$ server_cpu <movername> -halt <time>
where:
<movername> = name of the Data Mover or blade
<time> = when the Data Mover or blade is to be halted, specified as one of the following:
{ now | +<min> | <hour>:<min> }

Example:
To halt server_2 immediately, type:
$ server_cpu server_2 -halt now

Output
server_2 : done