From b54422b5cb1b350e23091c33f0c517de873283c5 Mon Sep 17 00:00:00 2001 From: gandc Date: Sat, 23 Nov 2024 18:15:28 +0300 Subject: [PATCH] add README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ zad1-lk => script | 0 2 files changed, 37 insertions(+) create mode 100644 README.md rename zad1-lk => script (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..cc05765 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# Simple Bash script + +Bash script that can list users and there dirs, processes, output stdout and stderr to files + +--- + + +## 1. RUN and TEST +1. Ensure the script is executable: + ```bash + chmod +x script +``` +2. Execute with -h to list help: +```Bash +./script -h +``` +Avalible options: +``` +-u, --users Display a list of users and their home directories +-p, --processes Display a list of running processes +-l, --log PATH Redirect output to a specified file +-e, --errors PATH Redirect error output to a specified file +-h, --help Show this message and terminate +``` +3. Logging example: +stdout +```Bash +./script -u -l /tmp/output.log +``` +stderr +```Bash +./script -u -e /tmp/error.log +``` +stdout with stderr at the same time +```Bash +./script -u -l /tmp/output.log -e /tmp/error.log +``` \ No newline at end of file diff --git a/zad1-lk b/script similarity index 100% rename from zad1-lk rename to script