4

i want to use sed to replace any x(small) to 0 if the line contains Z(capital)

x,Z,y
y,X,z,
Y,z,x
x,Z,y

1 Answer 1

8
$ sed '/Z/s/x/0/g' <input_file>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .