For this type of operation would write as follows
GREPCOUNT=`grep -c "nimrod" mylog.log`
if [[ $GREPCOUNT > 0 ]]
then
print "there's a nimrod in your log!"
fi
you have a misspelling; teypset should be typeset
you should change your addition line to a "let" statement
note the shorthand for initializing vars using typeset
list=list.txt
numbers=`cat $list`
typeset -i increment=0
typeset -i total=0
for increment in $numbers
do
let...
find ${WORK_DIR} -mtime +1 -exec rm -f {}
where ${WORK_DIR} is the directory.
You can get filename specific with -name option. Be aware that in HPUX, asterisks if
used as wildcards in this command should be escaped. Mtime is used for "modified time"
ctime is used for...
from the website ftp://nic.merit.edu/documents/rfc/rfc0959.txt
pages 39-42 Note that the error notes are NOT in numerical order, as he grouped them by functionality. The rest of the paper is a
deeper background and history of the protocol
4.2.1 Reply Codes by Function Groups
200 Command...
write a script called killme.sh
#!/usr/bin/ksh
## kills process launching this script
PROCESS_ID=$1 # uses 1st passed parameter # as the value for PROCESS_ID
KILL_HOUR=18 # choose your hour
KILL_MIN=05 # choose minute of hour
END="NO" # set a flag
until...
You can write your own kornshell script to
see if various servers are up, with no hangs
using the following
for REMOTE_HOST is (list your servers here)
do
ping ${REMOTE_HOST} -n 5 > ${TMP_FILE}
ERR=`grep -c " 0% packet loss" $TMP_FILE`
if [[ $ERR != 1 ]] ; then...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.