docs: add bash progress bar article
This commit is contained in:
parent
d73dd9d0fa
commit
97b9cb24ad
14 changed files with 1160 additions and 0 deletions
18
content/articles/2024/bash_printf/files/script1_ping.sh
Normal file
18
content/articles/2024/bash_printf/files/script1_ping.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
PING_ITER=16
|
||||
|
||||
# shellcheck disable=2317
|
||||
command() {
|
||||
local -r host=${1?"first parameter must be an host"}
|
||||
local -r iteration=${2?"second parameter must be an iteration number"}
|
||||
local -r cmd=(ping -c "${iteration}" "${host}")
|
||||
|
||||
"${cmd[@]}"
|
||||
}
|
||||
|
||||
main() {
|
||||
command "aquilenet.fr" "$PING_ITER"
|
||||
}
|
||||
|
||||
main
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue