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 7682643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:36:55+00:00 2026-05-31T18:36:55+00:00

I wish to append dddd to the next line whenever I encounter = in

  • 0

I wish to append ” dddd” to the next line whenever I encounter “=” in a textfile.

This command

sed -i '/=/s|$| dddd|' *.krn

is close to what I am looking for as it appends to the current line where “=” is. How can I append to the next line instead?

  • 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-05-31T18:36:56+00:00Added an answer on May 31, 2026 at 6:36 pm

    Use append, see here:

    • http://www.grymoire.com/Unix/Sed.html#uh-40

    E.g.:

    $ echo $'abc\ndef\ne=f\nqqq'
    abc
    def
    e=f
    qqq
    $ echo $'abc\ndef\ne=f\nqqq'|sed '/=/adddd'
    abc
    def
    e=f
    dddd
    qqq
    

    Edited to clarify as per comment from @je4d- if you want to append to what is present in the next line, you can use this:

    $ echo $'abc\ndef\ne=f\nqqq\nyyy'
    abc
    def
    e=f
    qqq
    yyy
    $ echo $'abc\ndef\ne=f\nqqq\nyyy'|sed '/=/{n;s/$/ dddd/}'
    abc
    def
    e=f
    qqq dddd
    yyy
    

    See here for a great sed cheatsheet for more info if you want:

    • http://www.catonmat.net/download/sed.stream.editor.cheat.sheet.txt
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to find all .docx files, and append them a string. This is
I wish to do this using only XAML - How to add an additional
I wish HTML could do something semantically equivalent to this; <dl class=main-list> <definitionitem> <dt>Some
I wish I could figure this out. I need to produce a table with
I have two existing dictionaries, and I wish to 'append' one of them to
I wish to compare two lists. Generally this is not a problem as I
I have string say ABC,D , now I wish to write a method append(initialStr,
I have list of dictonaries. I wish type iterate over this list and map
I wish to append new divs between already existing divs as shown in example.
I wish to run tf changeset 12345 Using the Visual Studio 2008 Command tool.

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.