Questions

Question 1

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Based on HW 6, Part II Problem 2, (or the script file “sub” on the last page of Lab6 Handout), please modify your bash/sed script “mysedprog” so that it will

remove the blank line(s),

delete the record for Nancy, and

substitute Jerry’s record with Anna’s record (Anna   95   97   98).

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Please test it using “sed –f mysedprog mysedfile” and make sure the output is correct, and then provide your “mysedprog” below along with the output of the execution of the script:

Question 2

By using “last” command without an option, the login time period is displayed as follow:

$ last

  • | grep “Jun 17” | head -2
  • cfs264su pts/0        35.139.208.173   Mon Jun 17 22:33 – 22:42  (00:08)cfs264su pts/20       152.117.114.217  Mon Jun 17 21:07 – 21:08  (00:00)

  • Please find a proper option, using information provided by Linux, so that the full login date/time information can be displayed as follow: (Hint: Linux command options are case sensitive)
  • $ last
  • | grep “Jun 17” | head -2cfs264su pts/0        35.139.208.173   Mon Jun 17 22:33:20 2024 – Mon Jun 17 22:42:06 2024  (00:08)cfs264su pts/20       152.117.114.217  Mon Jun 17 21:07:17 2024 – Mon Jun 17 21:08:09 2024  (00:00)

    Question 3:

    Based on HW 7, Part II Problem 1, please create a file called “myloginfile” as shown below and then write an awk scriptto determine how many logins in file “myloginfile” spent less than an hour on the system.

    $ last | grep “Jun 17” > myloginfile$ cat myloginfilecfs264su pts/0        35.139.208.173   Mon Jun 17 22:33 – 22:42  (00:08)cfs264su pts/20       152.117.114.217  Mon Jun 17 21:07 – 21:08  (00:00)cfs264su pts/17       68.46.76.194     Mon Jun 17 20:55 – 21:31  (00:35)cfs264su pts/6        76.156.71.67     Mon Jun 17 20:54 – 21:42  (00:48)cfs264su pts/22       73.62.176.252    Mon Jun 17 20:43 – 21:23  (00:40)cfs264su pts/21       63.231.165.128   Mon Jun 17 20:42 – 21:38  (00:55)cfs264su pts/20       152.117.114.217  Mon Jun 17 20:40 – 20:49  (00:08)… … …$

    Please provide your awk script below along with the output of the execution of the script:

    Question 4:

    Based on HW 5, Part II Problem 2, please write a shell script with a for-loop, which displays all the readablebut NOTexecutable files under /etc directory. Your script should NOTdisplay any directories. Please test your script on our server and provide your script below along with the output of the execution of your script.

    Question 5:

    Please use the solution of HW7, Part II Problem 2, (or the script file “awkc8” in Lab7 Handout) as a template to write a shell/awk script, myaverage4, that reads in 4 numbers and then uses a self-defined function to compute the average. The average should be displayed in the main program, not inside the function. Please use the following testing cases to test your script:

    $ ./myaverage4 2 7 4 3The average is 4$ ./myaverage4 -2 -1 -4 -5The average is -3

    Calculate your order
    275 words
    Total price: $0.00

    Top-quality papers guaranteed

    54

    100% original papers

    We sell only unique pieces of writing completed according to your demands.

    54

    Confidential service

    We use security encryption to keep your personal data protected.

    54

    Money-back guarantee

    We can give your money back if something goes wrong with your order.

    Enjoy the free features we offer to everyone

    1. Title page

      Get a free title page formatted according to the specifics of your particular style.

    2. Custom formatting

      Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

    3. Bibliography page

      Don’t pay extra for a list of references that perfectly fits your academic needs.

    4. 24/7 support assistance

      Ask us a question anytime you need to—we don’t charge extra for supporting you!

    Calculate how much your essay costs

    Type of paper
    Academic level
    Deadline
    550 words

    How to place an order

    • Choose the number of pages, your academic level, and deadline
    • Push the orange button
    • Give instructions for your paper
    • Pay with PayPal or a credit card
    • Track the progress of your order
    • Approve and enjoy your custom paper

    Ask experts to write you a cheap essay of excellent quality

    Place an order

    Order your essay today and save 30% with the discount code ESSAYHELP