Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7808155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:04:03+00:00 2026-06-02T03:04:03+00:00

If I execute this on Mac OS X 10.7.2 in the Terminal App: $

  • 0

If I execute this on Mac OS X 10.7.2 in the Terminal App:

$ cat test.txt | od -c

I get

0000000    t   e   s   t   1  \n   t   e   s   t   2                    
0000013

That’s the real content of my test.txt file. Ok.

But if I execute sed it adds a new line of each file.

$ sed 's/e/X/g' test.txt | od -c
0000000    t   X   s   t   1  \n   t   X   s   t   2  \n                
0000014

I don’t want this new line. How can I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:04:04+00:00Added an answer on June 2, 2026 at 3:04 am

    Use printf in awk. Special case the first line so that it is printed without a newline. All remaining lines are printed with a preceding newline. This ensures that you never end with a newline.

    Basic structure:

    awk 'NR==1 { printf("%s", $0); next }
         { printf("\n%s", $0) }'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I'm using Mac. Next, I need to execute this "file.sh" we will
I am trying to execute this SQL query prior to restoring a .BAK file
I want to execute this script (view source) that uses Google Translate AJAX API
Thanks to this answer I was able to get javascript to execute when being
I need to get this file ftp://1034733:ze3Kt699vy14@idx.living.net/idx_fl_ftp_down/idx_ftmyersbeach_dn/ftmyersbeach_data.zip to my site's server. THis seems like
I'm trying to execute this query: SELECT mac, creation_date FROM logs WHERE logs_type_id=11 AND
Im trying to execute this code on a mac. I have installed the curl.
I am trying to execute this SQL command: SELECT page.page_namespace, pagelinks.pl_namespace, COUNT(*) FROM page,
When I execute this query: Dim Var Var = ("select max(Autonumber) from tblAutonumber") DoCmd.RunSQL
I'm trying to execute this: $ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.