Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it into a file named users.txt.

Before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it into a file named users.txt. (Then, look at the file and study its format!) Afterwards, write a program that reads in and uses the 'split' function to break up each line of the 'users.txt' file into three variables: who, where, and when_and_IP, and then reprints it to the screen in this format: who on where at when_and_IP. split() without arguments splits on whitespace. So, if your text input file contains three lines, I expect to see code that produce three lines of output, each of which will look like: bsd17 on ttyp0 at Aug09 08:07 (132.85.201.182).

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

Students also viewed these Databases questions

Question

4. What decision would you make and why?

Answered: 1 week ago

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago