Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-21-2007, 03:31 PM   #1
LQ Newbie
Registered: Oct 2007
Location: Manitoba, Canada
Posts: 1

Rep: Reputation: 0
Scripting help please

I am very much a newbie when it comes to Linux scripting. I have however been summoned to write a simple script in which I am having difficulty even getting started. If anyone can help me out it would be greatly appreciated! Thanks in advance

Here are the requirements:

Write a script named file-info that includes the following:

1. Accepts a directory as an optional command line parameter.

2. Clears the screen.

3. Displays an error message and terminates if more than one parameter is provided.

4. Uses the current directory if no parameter is provided.

5. Displays an error message and terminates if the provided parameter is not a directory

6. For the directory to be processed, displays a single line of information about each regular file within it: file name, file size, file owner (in that order). For any file that is zero bytes in length, the script is to offer to delete the file, accepting only y/n responses and then proceeding accordingly.

7. Contains appropriate documentation and error checking. (Hint: the following command can be used to set the values of positional parameters: set -- $(ls l filename) This may be useful in this script although the script can be written using other commands already in your repertoire.)
Old 10-21-2007, 03:35 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
From the way the text is phrased it seems fairly clear this is some form of coursework / homework. we aren't here to do your learning for you. we can help you, sure, but that means we can get you past a syntax issue, a confusion over the right tool to do a single task... we can't tell you how to do all that.
Old 10-21-2007, 04:11 PM   #3
Registered: Sep 2007
Distribution: Puppy 5.2.8
Posts: 69

Rep: Reputation: 15
This subject is so generic and so well documented on the Internet.
Old 10-21-2007, 06:31 PM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
It even looks like cut and paste from the assignment.... ("...using other commands already in your repertoire")

Tell us more about the course, what texts you are using, etc.

How much of the assignment do you know how to do?


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
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
Scripting CICA Programming 5 10-04-2005 04:54 AM
Scripting help JediMasterTux Linux - Newbie 2 07-13-2004 01:29 AM
scripting help wedgeworth Linux - Software 10 09-25-2003 01:57 PM
HELP!! with scripting eggoz Linux - General 1 04-25-2003 07:52 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:25 PM.

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