LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2001, 08:53 AM   #1
Michael B.
LQ Newbie
 
Registered: Oct 2001
Location: Atlanta
Distribution: n/a
Posts: 1

Rep: Reputation: 0
Post I need help with my script


I need help with the following script. I have to present it tomorrow. Can some help me out by looking at the script and making a few suggestion.

PN=`basename “$0”` # Program name

Days=14 # remove files older than 14 days

Usage () {
echo “$PN – remove temporary files, clear the screen, show the current date, time, and display a list of current users,
usage : $PN – [-d days]

All files older than the specified number of days (default $Days) are deleted.” >&2
exit 1
}

Msg () {
for i
do echo “PN: $i” >$2
done
}

Fatal ( ) { Msg “$@”; exit 1; }

set -- `getopt hd; “$@”`
while [ $# -gt 0 ]
do
case “$1” in
-d) case “$2” in
[0-9]*) Days=”$2”; shift;;
*) Fatal “illegal number of days: $2”;;
esac;;
--) shift; break;;
-h) Usage;;
-*) Usage;;
*) break;; # First file name
esac
shift
done
#!/bin/csh –f
clear
date
echo “The users in the system are : “
who sort
 
Old 10-04-2001, 12:20 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
is this not college coursework? is this not cheating? If it is, you can't expect people to help, it would be ... cheating.

and anyway you've not said what's wrong with it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 05:19 AM
Directory listing - Calling shell script from a CGI script seran Programming 6 08-12-2005 12:08 AM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 11:23 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 01:20 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 05:21 PM


All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration