UNIX Scripting

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers UNIX Scripting
# 1  
Old 09-30-2016
UNIX Scripting

I am new to Unix and currently taking it for a college course. Unfortunately, I'm not understanding how to start a script. I am attaching my lab assignment. I know how to make the directories. Its just the scripting that is confusing me. If you could write or give me an idea how the script should look, I would be very grateful. Here are the directions:
Purpose: The purpose of this assignment is to write a shell
script with the name lab3.scr that will run various UNIX
commands and will redirect the output of the commands to
the file lab3.out and lab3.out1.

* Steps 1-09 listed below must be part of the lab3.scr script.
* Any output for steps 1-6 should be redirected to lab3.out.
* Any output for steps 7-09 should be redirected to lab3.out1.
* All files must be contained within your lab3 directory.
* Your script must contain comments with your name, course
number and your user id.

1. Create the directory lab3 and lab3/temp in your home directory.

2. Copy the lab3.readme.online file from /home/david to your lab3 directory.

3. List all files in the /home/david/lab3 directory that begin with names.

4. Copy all files in the /home/david/lab3 directory that have the file
extension .save to your lab3/temp directory. Display the list of files
copied to your lab3/temp directory [Bonus +10]

5. Sort the file /home/david/lab3/names in reverse order.

6. Display the active processes on the process status
list with only your user id number (UID) or your user
name (user1XX).

7. Display the first 15 lines of the file /home/david/lab3/passwd.
Display the last 7 lines of the file /home/david/lab3/passwd.

8. Display a sorted list of users logged into the system.
Sort the output by IP address.

9. Display a recursive long list of all files in your lab3 directory.

10. All files should be in your lab3 directory for grading.
lab3.readme.online, lab3.out, lab3.out1, lab3.scr.

Note: The lab3.scr script does not have to be moved to the lab3 directory
as part of the lab3.scr script. Just move the script file into your lab3
directory after your assignment is comp

Last edited by NeedHelpWithth; 09-30-2016 at 10:29 PM..
# 2  
Old 09-30-2016
Moderator's Comments:
Mod Comment This is not a site where you can ask other people to do your homework for you. If you make an honest effort at completing your work on your own and you get stuck; we will be happy to provide hints that may help you complete your assignment.

And classroom or homework problems cannot be posted in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulted in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.

Last edited by Don Cragun; 09-30-2016 at 11:02 PM.. Reason: Add note about how we will help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX scripting

LIST=/home/xxxxxxx/ABC/xeeno_scrpts/temp/tempfile ERRORDIR=/home/xxxxxxx/ABC/error_directory EMAILFILE=/home/xxxxxxx/ABC/xeeno_scrpts/temp/emailfile echo "There were errors in the following report file for Xeenos:" > $EMAILFILE echo >> $EMAILFILE echo "This files have been moved to... (9 Replies)
Discussion started by: bcarosi
9 Replies

2. UNIX for Dummies Questions & Answers

Unix Shell Scripting( Calling from Unix to PLSQL)

Hello Experts, I have the following questions to be discussed here at this esteemed discussion forum. I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)
Discussion started by: faizsaadq
1 Replies

3. UNIX for Advanced & Expert Users

Unix scripting

i need help with this problem this is the problem: Write a script that logs how many users login on/off the system over a 5 minute period. It can run in the foreground, and run 4 times a minute. Set a trap that will not allow a CNTRL-C command, and if a CNTRL-C is excuted store the time and date... (1 Reply)
Discussion started by: sportsmansixty6
1 Replies

4. Shell Programming and Scripting

Unix scripting

how to check if a unix script gets executed without errors across all unix platforms. incase if a script gets executed without errors only one platform say AIX, what needs to be done to that script such that it will run all unix platforms like linux, hp, sun etc (2 Replies)
Discussion started by: rmann
2 Replies

5. Shell Programming and Scripting

Unix Scripting

Hi Gurus, I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (4 Replies)
Discussion started by: madanmeer
4 Replies

6. UNIX for Dummies Questions & Answers

Unix Scripting

Hi Gurus, I am a system admin in solaris field and ive planned to study unix scripting.ive planned to start reading Mastering Unix scripting by randal.Scripts in that are based on Korn shell(ksh).my question is whether the same scripts can be applied to other shells like bash etc..And... (1 Reply)
Discussion started by: madanmeer
1 Replies

7. UNIX for Dummies Questions & Answers

Unix scripting pl help

Hi All, I am new to Unix Scripting. I have below scenario. I need to write a Unix function with the following. 1. I have table. From this table I need to write a query. SELECT Col1(File_nm),Col2(From_Loc),Col3(To_Loc) FROM A WHERE CONDITION For... (1 Reply)
Discussion started by: sree11
1 Replies

8. 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

9. UNIX for Dummies Questions & Answers

Help With Unix Scripting.

Can anybody tell me the best way to learn unix scripting.can you recommend a good book.Please help! (1 Reply)
Discussion started by: hella
1 Replies

10. UNIX for Dummies Questions & Answers

UNIX Scripting

:confused: I need to find a place or places on the Internet where I can find UNIX scripts to view and to modify to make life easy on the UNIX environment. Can someone help me on this. Thanks (7 Replies)
Discussion started by: wolf
7 Replies
Login or Register to Ask a Question