Help - Search - Members - Calendar
Full Version: Help With File-info Script
Linuxhelp > Support > Programming in Linux
i need help with making a bin/bash script that can do this, iam very new to linux so could you plz help ty

Write a script named file-info that:

- Accepts a directory as an optional command line parameter

- Clears the screen

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

- Uses the current directory if no parameter is provided.

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

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

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

ty in adavance
Good job on copying down your homework assignment.

How about learning how to do something yourself?
This has to be the best documentation of a homework assignment I have ever seen in a forum.

I give you an A+

This thread is now closed!
Yeah man, it takes the cake.

I would have loved to help him out.But not for free. biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.