Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Fri Dec 01, 2023 3:29 pm


Tips & Tricks, Questions regarding shell scripts, awk, perl, sed and much more.

Author Message
admin
Post  Post subject: AWK: How to replace a newline with actual \n  |  Posted: Thu Jul 20, 2017 11:02 am
Site Admin

Joined: Mon Aug 03, 2009 8:43 am
Posts: 104

Offline
 

AWK: How to replace a newline with actual \n

Code:
$ echo "
> here
> are
> multiple
> new
> lines" | awk '{printf "%s\\n", $0}'
\nhere\nare\nmultiple\nnew\nlines\n

_________________
VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX
https://vpsie.com





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "AWK: How to replace a newline with actual \n"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to echo newline in Linux/Unix shell

mandrei99

0

79948

Tue Jun 25, 2013 5:58 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to replace dot or any character with AWK

mandrei99

0

15975

Tue Jan 28, 2014 6:35 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to replace new line in perl script

mandrei99

1

5043

Wed Jun 26, 2013 8:18 am

admin View the latest post

There are no new unread posts for this topic. Unix shell - using TR to replace new lines with spaces

debuser

0

8957

Thu Feb 25, 2010 8:08 am

debuser View the latest post

There are no new unread posts for this topic. How to replace \w SED multiple matches on the same line without piping

mandrei99

0

3545

Tue Oct 08, 2013 6:29 am

mandrei99 View the latest post

There are no new unread posts for this topic. PERL: How to replace non-ascii characters/bytes in a file

admin

0

3464

Fri Apr 10, 2015 8:58 am

admin View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO