UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 3rd, 2004, 03:10 PM
Burlhouse Burlhouse is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 Burlhouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
electronic submit script

I need to create a shell script to be used for electronic submission of assignments. when the assignment is handed out to students the lecturer will start the script,and it will terminate on the due date and time after disallowing students access to the directory. The script should accept the directory name,date and time to terminate(in this order) as command line arguments.The script should have the following functionality:
(i)Creates a sub-directory under my home directory
(ii)Grants all users write access rights to the directory
(iii)Runs continusly in the background waiting for permissions to be automatically changed by the script(allowing only lecturer to have access rights) at a certain time date,terminating immediately after that.

Reply With Quote
  #2  
Old November 3rd, 2004, 04:05 PM
ShizukaWashi ShizukaWashi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Central Florida, U.S.A.
Posts: 77 ShizukaWashi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 55 sec
Reputation Power: 4
Send a message via AIM to ShizukaWashi Send a message via Yahoo to ShizukaWashi
How much of the script have you already written? Which areas are you having problems with? If you at least give us something to work with then we're more apt to help you out because it shows that at least you're trying.

Reply With Quote
  #3  
Old November 4th, 2004, 02:14 PM
Burlhouse Burlhouse is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 Burlhouse User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by ShizukaWashi
How much of the script have you already written? Which areas are you having problems with? If you at least give us something to work with then we're more apt to help you out because it shows that at least you're trying.


#so here it goes Shizuka

TIMESTAMP=`DATE + '%Y%m%d%H%M%S'`
umask 074

if [ $# -lt 2 ]

then

echo "Usage: $0 <directory><homework#>"
echo "example: $0 dir1 1"
echo "Where dir1 is the directory where homework resides,homework is an integer"

exit 1

fi

SUBDIR="/home/Homework_submitted/hw$2"

if [ ! -d $1 ]

then

echo "The directory $SUBDIR doesnt exist!"

exit 1

else

if [ ! -d "$SUBDIR/$USER" ]
then

echo "Looks like a new submission!"

mkdir "$SUBDIR/$USER
chmod 777 "$SUBDIR/$USER"
.
.
.
.
.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > electronic submit script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway