FAQ: Redirection - sed

Actually I figure it out how to solve the issue. :grinning:

  1. go to the file by below command:
    nano forests.txt

  2. delete everything and past the below text:
    The Amazon snowforest
    The congo snowforest
    Valdivian Temperate snowforest
    Daintree snowforest
    Southeast Asian snowforestsnowforest
    Tongrass National forest
    Sinharaja Forest Reserve
    Pacific Temperate snowforest snowforest

  3. Ctrl + O (the letter not zero)
    Click Enter
    Ctrl + X
    The problem should be solved. :wink:

1 Like

How was this solved because i am having the same problem

Thank you very much for the lead. Most grateful

1 Like

Is there a way to make the “sed” case insensitive? I tried playing around with it on my computer, and this was an issue I ran into pretty quickly. I assumed it would be an “i” input somewhere based on my previous experiences with the “grep” command, but I cant quite figure out where to put it.

Edit: I figured it out.
Attaching an “i” at the end of the command works. Example:

$ sed ‘s/hello/hi/i’ example.txt
or
$ sed ‘s/hello/hi/gi’ example.txt

To solve this,

  1. Copy the names below

The Amazon snowforest
The congo snowforest
Valdivian Temperate snowforest
Daintree snowforest
Southeast Asian snowforestsnowforest
Tongrass National forest
Sinharaja Forest Reserve
Pacific Temperate snowforest snowforest

  1. Overwrite the forests.txt file with the copied data.
    echo " (paste) " > forests.txt

  2. Solve the question.

I first made a test file with touch test.txt. I tested the commands there.

Help…

Just started the exercise and I am stuck.

Did you use cat forests.txt to see the its contents?

Go to “get unstuck” and reset the workspace.
That usually clears it up.

1 Like