Skip to main content
Add shell syntax highlighting
Source Link
Benjamin Loison
  • 5.8k
  • 4
  • 20
  • 37

The Perl version works the way you expected.

perl -i -p -e 's/\n//' file 
perl -i -p -e 's/\n//' file 

As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regular expression isn't as smart as you thought.

The Perl version works the way you expected.

perl -i -p -e 's/\n//' file 

As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regular expression isn't as smart as you thought.

The Perl version works the way you expected.

perl -i -p -e 's/\n//' file 

As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regular expression isn't as smart as you thought.

Copy edited. Added some context. Removed historical information (e.g. ref. <http://meta.stackexchange.com/a/230693> and <http://meta.stackoverflow.com/questions/266164>).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

The perlPerl version works the way you expected.

perl -i -p -e 's/\n//' file 

Edit: As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regexregular expression isn't as smart as you thought.

The perl version works the way you expected.

perl -i -p -e 's/\n//' file 

Edit: As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regex isn't as smart as you thought.

The Perl version works the way you expected.

perl -i -p -e 's/\n//' file 

As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regular expression isn't as smart as you thought.

Added -i.bak info
Source Link
ire_and_curses
  • 70.6k
  • 24
  • 120
  • 141

The perl version works the way you expected.

perl -i -p -e 's/\n//' file 

Edit: As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regex isn't as smart as you thought.

The perl version works the way you expected.

perl -i -p -e 's/\n//' file 

The perl version works the way you expected.

perl -i -p -e 's/\n//' file 

Edit: As pointed out in the comments, it's worth noting that this edits in place. -i.bak will give you a backup of the original file before the replacement in case your regex isn't as smart as you thought.

Source Link
ire_and_curses
  • 70.6k
  • 24
  • 120
  • 141
Loading