Computing.Net > Forums > Linux > Linux shell scipting help

Linux shell scipting help

Reply to Message Icon

Original Message
Name: RRC
Date: October 22, 2007 at 19:48:17 Pacific
Subject: Linux shell scipting help
OS: Linux/Windows XP Pro
CPU/Ram: AMD Athlon, 512 MB
Model/Manufacturer: Home Built
Comment:

Good evening fellow techies!

I am very much a newbie when It comes to Linux. I am currently taking a course on this wonderful OS.
I was wondering if someone would be so kind to lend me a hand with some sripting.
I want to make it very clear that I DON'T expect all of the answers, just some help to get me started on the script. I am really only 2 weeks into the course, and this assignment seems so overwhelming for really only a beginner!

Here is what I need to do:

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)


Report Offensive Message For Removal


Response Number 1
Name: lordmanhamer
Date: October 29, 2007 at 09:14:29 Pacific
Subject: Linux shell scipting help
Reply: (edit)

sounds like a course i took back in uni a long time ago. we had this course on operating systems and this was one of the assements for it. i hope this isnt for uni cos that colusion and therfore cheating.
im sure its not.
anyway look into case statements for the menu and the comand clear clears the screen.
you also want to use the read user command.
and while loop the rest is up to you.

so the pueudo code would be

set up varriables
while input varible isnt escape comand
clear screen
print menu
get users responce
start case
case1 -------------
case2 -------------
case3 -------------
case nth
end case
end while
clear screen
print good bye

all text needs typos. There there for the reader to find,to distract them from the total lack of content.
google it! wasnt the answer to the question i asked so dont be dense and give me that repl


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Linux shell scipting help

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge