add README.md
This commit is contained in:
parent
394e3df3e7
commit
b54422b5cb
37
README.md
Normal file
37
README.md
Normal file
@ -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
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user