1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-02 01:39:26 +00:00

Make shell scripts (almost) POSIX compliant

This commit is contained in:
2019-11-17 17:29:34 +01:00
parent 9d6bbeae7c
commit 5211d4aacb
6 changed files with 38 additions and 55 deletions

View File

@ -3,10 +3,9 @@
OUTPUT=""
openvpn=$(pgrep -c openvpn$)
[[ $openvpn -gt 0 ]] && OUTPUT=$(eval printf "%.0s" {1..$openvpn})
[ "$openvpn" -gt 0 ] && OUTPUT=$(eval printf "%.0s" "{1..$openvpn}")
openfortivpn=$(pgrep -c openfortivpn$)
[[ $openfortivpn -gt 0 ]] && OUTPUT=${OUTPUT}$(eval printf '%.0s' {1..$openfortivpn})
echo $OUTPUT | sed -e 's/\(.\)/\1 /g'
[ "$openfortivpn" -gt 0 ] && OUTPUT=${OUTPUT}$(eval printf '%.0s' "{1..$openfortivpn}")
echo "$OUTPUT" | sed -e 's/\(.\)/\1 /g'