Skip to main content
added 3 characters in body
Source Link
phuclv
  • 2.4k
  • 1
  • 22
  • 47

Why the dash in foo-baz is not replaced?

1)The s/-/_/g command operates line by line before all lines are appended by N.

2)The second line (foo-baz) has dash not replaced yet while being appended.

3)The replacement command does not rerun on the combined, newline-removed string.

  1. The s/-/_/g command operates line by line before all lines are appended by N.

  2. The second line (foo-baz) has dash not replaced yet while being appended.

  3. The replacement command does not rerun on the combined, newline-removed string.

Result: the dash remains in the final joined output.

Why the dash in foo-baz is not replaced?

1)The s/-/_/g command operates line by line before all lines are appended by N.

2)The second line (foo-baz) has dash not replaced yet while being appended.

3)The replacement command does not rerun on the combined, newline-removed string.

Result: the dash remains in the final joined output.

Why the dash in foo-baz is not replaced?

  1. The s/-/_/g command operates line by line before all lines are appended by N.

  2. The second line (foo-baz) has dash not replaced yet while being appended.

  3. The replacement command does not rerun on the combined, newline-removed string.

Result: the dash remains in the final joined output.

Source Link
DineshS
  • 121
  • 1

Why the dash in foo-baz is not replaced?

1)The s/-/_/g command operates line by line before all lines are appended by N.

2)The second line (foo-baz) has dash not replaced yet while being appended.

3)The replacement command does not rerun on the combined, newline-removed string.

Result: the dash remains in the final joined output.