Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started