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