Question

I have to do this question using UNIX commands (or terminal on Apple computers) If you...

I have to do this question using UNIX commands (or terminal on Apple computers)

  1. If you have a data file called datafile(below)
    1. Show only line 3
    2. Show only the last line
    3. For all lines that have the string key in it change the word more to other
    4. Print lines that follow this pattern of four characters: the first letter is an m and the last is a n – the two intervening letters can be anything.
    5. Print all lines that do not contain the word ann
    6. Remember that all comment lines begin with a #. Now you want to print all non-

comment lines.

  1. Add “.5” to num4 on all lines

This is the contents of datafile

#FirstName LastName more num1 num2 num3 num4

Charles Mainkey more 3.0     .98     3       34

Sharon Key more 5.3     .97     5       23

Patricia Hemenway more 4.0     .7      4       17

TB Savage more 4.4     .84     5       20

AM Main Jr. more 5.1     .94     3       13

Marnot Weber more 4.5     .89     5        9

Ann Stephens more 5.7     .94     5       13

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

sed -n '3p' datafile

b)

tail -n 1 datafile

NOTE: As per Chegg policy I am allowed to answer specific number of questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
I have to do this question using UNIX commands (or terminal on Apple computers) If you...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ I am using visual studio for it. Make a copy of the Rational class you...

    C++ I am using visual studio for it. Make a copy of the Rational class you created in the previous Lab. Modify the class. Replace all your mathematical, input, and output functions with overloaded operators. Overload the following 12 operators: + - * / < > = = ! = <= >= >> << In order to test your class in your main function, prompt the user for a numerator and a denominator for your first object. Repeat the prompt...

  • "Please Solve Problem 2 Please" Program 1(Total Point 15): You will use scanner class and ask...

    "Please Solve Problem 2 Please" Program 1(Total Point 15): You will use scanner class and ask users to enter numbers from 0 to 10 numbers. You will then extract only non prime numbers and store it in the set. You will then print the entire set contents. Problem 2(Total Point 15): Write a Java program that performs following things. Generate 10 random numbers Store all the numbers into the set Use the iterator or any other class to extract all...

  • Hello Guys. I need help with this its in java In this project you will implement...

    Hello Guys. I need help with this its in java In this project you will implement a Java program that will print several shapes and patterns according to uses input. This program will allow the use to select the type (say, rectangle, triangle, or diamond), the size and the fill character for a shape. All operations will be performed based on the user input which will respond to a dynamic menu that will be presented. Specifically, the menu will guide...

  • C++ requirements The store number must be of type unsigned int. The sales value must be...

    C++ requirements The store number must be of type unsigned int. The sales value must be of of type long long int. Your program must properly check for end of file. See the section Reading in files below and also see your Gaddis text book for details on reading in file and checking for end of file. Your program must properly open and close all files. Failure to follow the C++ requirements could reduce the points received from passing the...

  • can you do this js and html question. ill give you the html and js and...

    can you do this js and html question. ill give you the html and js and css files just fix my error use if and else like what i did dont use switch just fix my erorr. <!DOCTYPE html> <!-- Webpage HTML document for Lab 4. Authors: Amirhossein Chinaei, Andriy Pavlovych For: EECS 1012, York University, Lassonde School of Engineering --> <html lang="En"> <head> <meta charset="UTF-8"> <!-- title for web page --> <title> EECS1012: Lab 4 - Computational Thinking </title>...

  • Question 2 0/1 point (graded) What happens when you remove a directory using the command rm...

    Question 2 0/1 point (graded) What happens when you remove a directory using the command rm -r? You cannot remove a directory using the rm command. You permanently remove the entire directory, including all files and subdirectories. You move the entire directory to a trash folder, but it can be restored later. You get a warning message asking if you want to proceed, then you delete the directory. incorrect Answer Incorrect: Try again. Unix does not warn you before permanently...

  • LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class...

    LAB1 PART 1 FOR THE DATA TYPE CLASS: If you do not have UML of class Account_yourLastName, you should do that first Basesd on the UML, provide the code of data type class Account_yourLastName to hold the information of an account with account number (String), name (String), balance (double), with no-argument constructor, parameter constructor Also, define some methods to handle the tasks: open account, check current balance, deposit, withdraw, and print monthly statement. At the end of each task we...

  • Hi, please help with the below question. I have posted the option that you can choose...

    Hi, please help with the below question. I have posted the option that you can choose for the column, and make sure you follow the format as been listed in the chart below! Only answer the question in the case that you can make sure you would answer them all! Thank you! The following transactions of Penny and Dime Marine Supply occurred during 2018 and 2019: (Click the icon to view the transactions.) Requirement 1. Record the transactions in the...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT