Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use python, before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it intoa file named

Use python, before you start to write the next script, first run the 'who' command at the UNIX prompt and redirect it intoa 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. 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

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

ISBN: 0130913677, 978-0130913678

More Books

Students also viewed these Databases questions