linux - Why sed yields two same line? -


i wanted replace 1 line using sed, got 2 same lines:

$ sed '50s/false/true/p' ./src/com/android/quicksearchbox/searchablesource.java >searchablesource.java.1    $ diff searchablesource.java.1 ./src/com/android/quicksearchbox/searchablesource.java 50,51c50 <     private static final boolean dbg = true; <     private static final boolean dbg = true; --- >     private static final boolean dbg = false; 

why? how wanted?

the p @ end means "print". told sed print line after successful substitution. sed prints each line (if not told not -n) anyway. have not told wanted, either remove final p or specify -n option.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -