Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by rarnold1

  1. rarnold1

    if grep -- don't want it to print the matched string

    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
  2. rarnold1

    Mathematic expressions...

    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...
  3. rarnold1

    Detecting how old a file is

    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...
  4. rarnold1

    Need ftp codes (for errors)

    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...
  5. rarnold1

    Help! Unix greenie with scripting question ( I think)

    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...
  6. rarnold1

    Date - 30

    For those into perl, there is a datecalc function that handles date & time math better than any other fuction I have seen
  7. rarnold1

    Help implementing "goto <label>" in korn shell script....

    goto's are horrible. Try to work with functions in the script and call the function when you want to goto somewhere.
  8. rarnold1

    ksh script challange

    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...

Part and Inventory Search

Back
Top