POS 420 Week 4 IA

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions POS 420 Week 4 IA
# 1  
Old 08-27-2010
Network POS 420 Week 4 IA

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:
  • <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoNormal>In your week4 directory create a script called “yourlastname”.scr (e.g. miller.scr) that will: (while there are many ways to write this script I expect you will utilize the commands contained in the text and lectures)
    • <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Display a line that contains your name (e. g. Alan Miller) as the author<LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Display the current date in the following form: day, date (e.g. Wednesday, May 12, 2004)
    • Display the contents of a file that you previously submitted during the one of the previous weeks of this course. (Note: You must use relative addressing for the paths so your script will work both in your week4 directory and mine.)
      • the script should request user input to select the week and then list all the files you placed that week in my directory
      • the script should then request user input for the name of the file and display the contents
    • <LI style="MARGIN: 0in 0in 0pt; mso-list: l1 level2 lfo2; tab-stops: list 1.0in" class=MsoNormal>Your script should work with unexpected input (e.g. non-existent week and/or file name) and inform user of bad input plus request user to enter correct input.
    • Your script should repeat step c until directed by user to stop
  • Post this file to the Assignment section.

2. Relevant commands, code, scripts, algorithms:

Experience from previous classes has shown the need for the following tips:
    • <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script must work on my computer running Knoppix in the week4 directory and list only the files you previously submitted to the Assignments NG in the appropriate week. Each week I copied your files to the appropriate week directory on my computer. Since every student's files are in my directory your script must list only your files. (remember your files always start with your last name) <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script must not change my current working directory from week4 or close my terminal window so you should use relative path addressing and avoid the exit command <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script should only accept weeks 1-3 as input <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script should tell me what the format of my input should be (e.g. 1 or week1, etc.) <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script should allow me to quit when the week input is requested <LI style="MARGIN: 0in 0in 0pt; mso-list: l0 level2 lfo1; tab-stops: list 1.0in" class=MsoNormal>Your script should reject out of range input and ask me again for the correct input
    • Your script should never execute a command that fails.

Remember to ask questions about anything that isn't clear or you need assistance with.


3. The attempts at a solution (include all code and scripts):
Code:
 echo "Aaron Smiley"
 date +"%A, %B %d, %Y"
 declare -i num
 echo "Enter week number or q to quit: "
 read num
 while $num != q
 do
         if [ $num -lt 4 ]
            then
               echo "The files you submitted in week $num are"
                      ls ../week$num-smiley
            else
               echo "The week number is invalid"
         fi
         echo "Enter week number or q to quit: "
         read num
done

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Phoenix, Arlington, Tx. USA
Alan Miller POS/420 http://classroom.phoenix.edu/afm213/...eadID=24204586

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

Last edited by Scott; 08-28-2010 at 06:19 AM.. Reason: Added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check Character matching from pos 7-15 to pos 211-219 if True then replace 211-219 with spaces

Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space. Total length of record is 420. Here is the specification of the data in file. Position Field Data Type... (5 Replies)
Discussion started by: lancesunny
5 Replies
Login or Register to Ask a Question