Question: I have the command to perform the option but it is not working in vi. So I need help with writing script for this option.

I have the command to perform the option but it is not working in vi. So I need help with writing script for this option.

  1. Extract the process names and use a filtering command to sort and uniquely display the process names
  2. Extract the user names and use a filtering command to sort and uniquely display the user names

Mean I have script and if I press 1 option it should show all the process name with sort and uniq of specific file I selected to excite the script. and if I press 2 it should show all the usernames with sort and uniq.

The command I came with for both script is below and it is working correctly. But I dont know how to put these files in vi so that it can work on script.

  1. awk'BEGIN{FS="|"; OFS="|"} {print $2}' dailyUserProcs.20200401 | sort | uniq
  2. awk'BEGIN{FS="|"; OFS="|"} {print $1}' dailyUserProcs.20200401 | sort | uniq

The file has 3 column, first one is name, second one is process and third one is numbers of logins.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!