Find the answer to your Linux question:
Results 1 to 2 of 2
Hello everyone, I'm currently in a linux course and just gearing up to take an exam. I'm now learning scripting and I am familiar with the logic's from the text ...
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    1

    Help with linux assignment. New to scripting.

    Hello everyone,

    I'm currently in a linux course and just gearing up to take an exam. I'm now learning scripting and I am familiar with the logic's from the text book. When it actually comes down to reading an assignment and interpreting it back to a script I don't know where to start. If anyone can point me on the right direction it would be great-full. Thanks in advance.

    Basically my assignment:

    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.)

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,093
    Quote Originally Posted by Almondoz View Post
    Help with linux assignment
    Hello and welcome to the forums!

    Sorry, but homework questions are not allowed on the forums:

    http://www.linuxforums.org/forum/lin...ums-rules.html
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...