isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

commit 86d5e4565ccf98be966fa3bb1f443c975820b1f2
parent e166406740278a4ae4d5b1c0d6fdb2be21cbcc42
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Mon, 25 Nov 2024 11:50:20 +0100

posix, possibilité de lister les options avec -o

./posix -o chmod
-R

Diffstat:
Mposix.sh | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/posix.sh b/posix.sh @@ -1,5 +1,15 @@ #! /bin/sh -[ -f bdd/${1:?need command}.html ] \ - && ${BROWSER:-w3m} "bdd/$1.html" \ - || echo "$1 not a posix command" +while getopts "o" opt; do + case "$opt" in + ( o ) optflag=0;shift;; + esac +done + +if [ -f bdd/${1:?need command}.html ];then + [ $optflag = 0 ] \ + && < "bdd/$1.html" grep -E "<dt><b>-.[&<].*</dt>" | grep -o "\-." \ + || ${BROWSER:-w3m} "bdd/$1.html" +else + echo "$1 not a posix command" +fi