Shell script to generate report for each user ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script to generate report for each user ?
# 1  
Old 02-01-2017
Shell script to generate report for each user ?

I have 3 user in my linux machine let's say a,b,c .By Using last command I am able to identify list of last logged in user and by w command who is logged in and what they are doing and by history command all command used by particular user all will be shown.


Now I want to write shell script which will show how much time ideal,how much they are logged in and how much command they have run for each user.

How to do this?
# 2  
Old 02-01-2017
Welcome beingswarupmall,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.


Kind regards,
Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell script newbie- how to generate service log from shell script

Hi, I am totally a newbie to any programming languages and I just started an entry level job in an IT company. One of my recent tasks is to create a script that is able to show the log file of linux service (i.e. ntpd service) lets say, if I run my script ./test.sh, the output should be... (3 Replies)
Discussion started by: xiaogeji
3 Replies

2. Shell Programming and Scripting

Generate documentation for a shell script

Hi, I've written a shell script with proper intentation and commenting structure. However, I would like to generate documentation for the shell which I have written. Is there any tool as such to generate it like we have javagen/docgen ? Please help. Thanks, Arjun (0 Replies)
Discussion started by: arjun_arippa
0 Replies

3. Shell Programming and Scripting

UNIX script generate report grouped on date

Dear Team, I am try n gerrating a report by writing a shell script, the content of the report should be aggrigated based on date value exist in the content of the file. initially the file is zip format My file content is in below format 031627787 034626800357002013050613310400000013500 CLT01... (1 Reply)
Discussion started by: balram0179
1 Replies

4. Shell Programming and Scripting

Shell script to compare and generate a new file

Requirement is I have two files their format is File1 - input_file ----- tmp_value|3|number|| tmp_value1|3|alpha|| tmp_value2|6|alpha|AA AA| tmp_value3|15|number|000000005| tmp_value4|15|number|000000000000000| tmp_value5|11|alpha|bbbbbbbbbbb| tmp_value6|11|alpha|bb bb| input_file ... (4 Replies)
Discussion started by: greenworld123
4 Replies

5. Shell Programming and Scripting

Need a script that generate a report from a combined sudoers

Hello Gurus Is anyone aware of a script/utility that can be used to generate a report from a combined "sudoers" file for more than 100 servers in one go please? Basic query: Which particular user or an user group can execute root equivalent commands or has the ability for e.g. to do a... (1 Reply)
Discussion started by: kapil514
1 Replies

6. Web Development

Automation Script to generate SLA report as PPT

Hi All, We have one client.for this client some jobs got scheduled. Those jobs will run daily/weekly/Monthly. But once it runs it will generate some log files with date and Timestamp. In log folder it contains the complete logs of that particular job. By end of every month we are going to take... (0 Replies)
Discussion started by: vasuvv
0 Replies

7. Shell Programming and Scripting

generate logfile in a shell script

Unix Gurus, I have a shell script which has few "echo" statements. I am trying to create a logfile where all the outputs of the echo statement sare stored. I will have to add this as the final step in the existing script so that everytime the script runs, a logfile is generated with all the... (1 Reply)
Discussion started by: shankar1dada
1 Replies

8. Infrastructure Monitoring

Shell Script - Generate SNMP Traps

Good morning to you all I´m kinda of a noob to scripting, and my knowledge is still very basic: anyway, I´ve developed a small .sh script with the following purpose: - it will check a result file, checking if it has any values, or if it´s empty - if it´s empty it will send an email What... (0 Replies)
Discussion started by: zarahel
0 Replies

9. Shell Programming and Scripting

how do i generate random integer using only shell script

Hi All, I need to generate 4 digit random no using only shell script. Please help in this ASAP. Thanks in advance... Regards, sridhar. (1 Reply)
Discussion started by: sridhusha
1 Replies

10. UNIX for Dummies Questions & Answers

generate xml from a shell script

Hello! I would like to generate an xml file from the output of various commands generated from within a shell script (some will be in CDATA). At the moment the only solution I have come up with is echoing xml tags around the commands eg. echo "<bitism>" >> outputfile /usr/sbin/prtconf... (1 Reply)
Discussion started by: speedieB
1 Replies
Login or Register to Ask a Question