template-bash/README.md

38 lines
1.0 KiB
Markdown
Raw Normal View History

2023-01-05 19:02:20 +03:00
# template-bash
2023-03-14 22:14:29 +03:00
2023-01-05 19:25:24 +03:00
Template repository for projects on bash
2023-01-05 19:02:20 +03:00
2023-01-05 19:52:51 +03:00
* [`script.sh`](https://git.hmp.today/pavel.muhortov/template-bash#script-sh)
2023-01-05 19:25:24 +03:00
____
2023-03-14 22:14:29 +03:00
2023-01-05 19:52:51 +03:00
## `script.sh`
2023-03-14 22:14:29 +03:00
2023-01-05 19:25:24 +03:00
**Description:**
> returning current username if privileged rights are exist
> or
> returning error, if privileged rights are not exist
**Dependencies:**
2023-03-14 22:14:29 +03:00
>
> * [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
> * [whoami](https://www.gnu.org/software/coreutils/whoami) (tested version 8.30 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
2023-01-05 19:25:24 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
2023-03-14 22:14:29 +03:00
| 1 |**[qn]**|execution without pauses||
| 2 |**[/path/to/conf]**|path to config|`./script.conf`|
2023-01-05 19:25:24 +03:00
Example usage in terminal with bash:
2023-03-14 22:14:29 +03:00
```bash
2023-01-05 19:25:24 +03:00
bash ./script.sh qn ./script.conf
```
2023-03-14 22:14:29 +03:00
2023-01-05 19:25:24 +03:00
Example usage in terminal with make the script executable:
2023-03-14 22:14:29 +03:00
```bash
2023-01-05 19:25:24 +03:00
chmod u+x ./script.sh
script.sh
```