Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a sed script which transforms a text file into proper C You will need to: Delete the first three lines of the input Delete

Write a sed script which transforms a text file into proper C

You will need to:

  • Delete the first three lines of the input
  • Delete anything after #, leaving no empty lines behind
  • Convert BEGIN into the #include and main lines
  • Convert HELLO into the printf
  • Convert END into the trailing }

Input File

The first three lines should be ignored Don't include them in your output So you'll need to tell 'sed' to ignore them

# # This is a comment #

BEGIN HELLO # so is this! END

Copy and paste that into a file on your machine, and write a sed script to turn it into the following:

#include

int main()

{

printf("hello, world ");

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago