Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Scripting Homework, need help Post 303017742 by arbogastcarl on Monday 21st of May 2018 01:42:10 PM
Old 05-21-2018
Scripting Homework, need help

Hi I just started scripting in my Unix class, but can't understand it and have trouble with homework. This is my homework:

Dean needs a daily written report of the status of his Unix computer. He wants to obtain certain information about users and processes that are only accessible by executing utility commands. He does not want to have to execute these commands every day and has asked you to help him write a script that employs these utilities to obtain the information he needs. He would also like the results of the execution script to be saved to a file.

Step 1: Open the vi editor to create a script called Information. Add the contents from the following table to the script.

Headings Utilities
Today's date is: date
The current users logged into the system are: who , cut or awk, sort, uniq
My current startup directory is: pwd
Today's identification information is: id
The processes running on my system are: ps

Step 2: Save the script and exit to the shell. Make the script executable and proceed to run the Information script. Submit your script to Canvas.

Step 3: Redirect the output of the Information script to a file named DailyInfo that Dean can access daily.

can somebody guide on how to do it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies

2. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

3. Shell Programming and Scripting

Unix Scripting Question (Homework)

Hello im currently taking up Operating Systems and we're on unix ryt now. we have to make a script and here are the requirements.. can someone please help me. I would reli appreciate it.. because i dont reli know how to make scripts yet. Name of script : parkingcharge.sh Create a script that... (1 Reply)
Discussion started by: pitdark
1 Replies

4. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

5. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

6. Android

Android Scripting Environment: Shell Scripting and Android

I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Discussion started by: Neo
0 Replies

7. Homework & Coursework Questions

Need some help with my homework

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi, since I'm relatively new to Unix I need some help. I've installed FreeBSD 8 on a virtual machine and I've done... (4 Replies)
Discussion started by: iLeeT777
4 Replies

8. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

9. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

10. Homework & Coursework Questions

Perl Scripting issue - homework

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is the problem: Lesson 13 OBJ1: OST Class online. Write a script called obj13-1.pl and a library... (2 Replies)
Discussion started by: valhalla
2 Replies
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-k] [-q] [-t time] [file [command ...]] DESCRIPTION
The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. If the argument command ... is given, script will run the specified command with an optional argument vector instead of an interactive shell. Options: -a Append the output to file or typescript, retaining the prior contents. -k Log keys sent to program as well as output. -q Run in quiet mode, omit the start and stop status messages. -t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The default interval is 30 seconds. The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism). HISTORY
The script command appeared in 3.0BSD. BUGS
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues. When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when in a raw mode where the program being run is doing manual echo. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy