sed output blank in bash script -
i have file consists of following hundred lines in addition other data
(abc-wxyz1/2222 1234)
1234 random number different 100 lines. want substitute lines with
(abc-wxyz1/2222 *)
i using following code it
cat input.txt | \ sed -i -e 's/\(abc\-wxyz1\/2222\ [0-9]\+\)/\(abc\-wxyz1\/2222\ \*\)/g' > output.txt
i output.txt blank have no clue why. doing correctly ?
if you're going use flag -i, --in place
, don't have redirect output. substitutions performed in place, expected.
yet, can simplify expression, doing:
sed -i -e 's/abc\-wxyz1\/2222\ \([0-9]\+\)/*/g' input.txt
Comments
Post a Comment