Hs old-muro

From HSS
Revision as of 01:09, 26 January 2024 by C0 (talk | contribs) (Created page with "== código == <pre> #!/bin/sh # # touch /var/hsmurotxt # root@anfibio:~# chmod +x /var/hsmurotxt while getopts 'p:v:' c do case $c in p) p="$OPTARG" ;; v) v="$OPTARG" ;; esac done info="modo de uso blabla" if [ -z "$v" ] ; then if [ -z "$p" ] ; then echo "$in-d "1" fo" else echo $(whoami) @ $(date) "$p" >> /var/hsmurotxt fi else if [ $(echo "$v" | grep -E "^[0-9]+$") ] ; then cat /var/hsmurotxt | tail -n "$v" fi fi </pre>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

código

#!/bin/sh
#

# touch /var/hsmurotxt
# root@anfibio:~# chmod +x /var/hsmurotxt


while getopts 'p:v:' c
do
  case $c in
    p) p="$OPTARG" ;;
    v) v="$OPTARG" ;;
  esac
done

info="modo de uso blabla"
if [ -z "$v" ] ; then
    if [ -z "$p" ] ; then
	echo "$in-d "1" fo"
    else
	echo $(whoami) @ $(date) "$p" >> /var/hsmurotxt
    fi
else
    if [ $(echo "$v" | grep -E "^[0-9]+$") ] ; then
	cat /var/hsmurotxt | tail -n "$v"
    fi
fi