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
Post a Comment