Hs old-muro

From HSS
Revision as of 01:09, 26 January 2024 by C0 (talk | contribs)

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