Difference between revisions of "CSC220 Homework 1 2010"
(→Problem #2) |
(→Problem #2) |
||
Line 54: | Line 54: | ||
</pre></code> | </pre></code> | ||
− | * Store your script in a file called | + | * Store your script in a file called '''allUsersByDate2.sh''' and submit it as follows: |
+ | |||
+ | submit hw1 allUsersByDate2.sh |
Revision as of 12:53, 14 September 2010
Problem #1
Write a script that lists all the users on grendel by year of last access to their account. The output should list all the years starting in 2005 and ending in 2010.
An example of the output could be
2005:
2006:
drwx------ 4 root root 16384 Jul 11 2006 lost+found/ (not really a user but that is ok)
drwxr-xr-x 3 flatland users 4096 Jul 11 2006 flatland/
drwxr-xr-x 7 bmikic faculty 4096 Jul 11 2006 bmikic/
drwxr-xr-x 23 102155 users 4096 Aug 3 2006 mmartin2/
2007:
drwxr-xr-x 3 root root 4096 Apr 18 2007 keterhome/
drwxr-xr-x 155 cleung users 12288 May 18 2007 snida/
drwxr-xr-x 43 zeno users 20480 Aug 14 2007 zeno/
etc...
- store your script in a file called allUsersByDate.sh and submit it as follows:
submit hw1 allUsersByDate.sh
- (For those of you who have never used our class system before, you need to be logged in your 220a-xx account to submit your programs. They get copied to the instructor's directory automatically, and time-stamped. You can submit a program as many times as you want, but be aware that each submission overwrites the previous contents of a file.)
Problem #2
- Same as Problem #1, but this time the output should be just the user's name, not the whole line showing the permissions, date, etc.
- Your output should not include the lost+found, which is not a user but just a regular directory.
- Example:
2006:
flatland/
bmikic/
mmartin2/
- Store your script in a file called allUsersByDate2.sh and submit it as follows:
submit hw1 allUsersByDate2.sh