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 TouchToneTommy 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 pmurray99

  1. pmurray99

    How do I catenate over 400 files into one file?

    If you want to process files in a single directory (ie no sub directories) a simple ls will do:- ls myfiles*.dat | cat >> newfile HTH
  2. pmurray99

    Multiple pattrens for grep

    egrep $1\|$2 $my_file HTH
  3. pmurray99

    korn shell script in rc*.d

    I've just tried a few things... the #!/usr... line is being ignored, probably because init is invoking your script. Probably the same reason why $SHELL is not set. Change your S?? startup script to run the korn shell script.
  4. pmurray99

    How to set an user account that valid for 1 session only

    run this via root cron:- #!/usr/bin/ksh UserName=$1 who |grep "^${UserName} " > /dev/null 2>&1 && { while : do sleep 60 who |grep "^${UserName} " > /dev/null 2>&1 || { passwd -l...
  5. pmurray99

    korn shell script in rc*.d

    oops didn't notice the #!/usr/bin/ksh line ksh should run this script ok A potential source of the "set" error could be the contents of pfile.
  6. pmurray99

    korn shell script in rc*.d

    set -A not available in Bourne shell I replied to your post on Unix scripting forum. It would be helpfull if you didn't cross post.
  7. pmurray99

    korn shell script in rc*.d directory

    These scripts are run by root. root's shell is usually /sbin/sh (Bourne) You can run a Korn shell script during startup if you put the #!/bin/ksh line at the start of the script. Make sure that /usr is mounted before you run a Korn shell script. /bin is a symlink to /usr/bin.
  8. pmurray99

    greping in a date range

    #!/usr/bin/ksh Fdate=20030702 Ldate=20030704 ans=x ls -1 bat.log* | while read -- File do [[ ${File##*.} -ge $Fdate && ${File##*.} -le $Ldate ]] && grep $ans $File /dev/null done
  9. pmurray99

    Rename Filename Error

    #!/usr/bin/ksh FileA=LOAN_APPL20031209122345 FileB=LOAN_APPL_STATUS20031109122355 mv $FileA ${FileA##+([A-Z_])} mv $FileB ${FileB##+([A-Z_])}
  10. pmurray99

    help with recursive chown

    man find find / -user 1001 | while read -- FILE do print chown username:groupname $FILE done when you've tested it, remove the print
  11. pmurray99

    Hi I have a main program script

    try xfile.sh | tee -a mylog But I'm not sure I understand what you're asking
  12. pmurray99

    Hi I have a main program script

    this function checks if $1 is an integer Not sure if it works in bash isnum() { case ${1} in +([0-9])) return 0 ;; *) return 1 ;; esac } or in your case where you're testing for an integer > 0 let $x 2> /dev/null and check the return code Salem's right about [ ed ...
  13. pmurray99

    How to go through a file 1 line at a time

    #!/bin/ksh while read -- line do set -- $line # this loads $1 $2 .. with each field in $line do some stuff done < MyFile You can also get the individual fields like this while read -- f1 f2 f3 All this assumes that the field separater in the file is white space. If not, you'll...
  14. pmurray99

    Pipe statement in While Loop

    the grep, awk and | are behaving as expected. It's the output from the grep that is causing the problem. grep will return the count of occurences in pattern, or the pattern, or the filename depending on the option. BUT it will only return 1 token. Try this:- [[ $(grep -c &quot;yo&quot...
  15. pmurray99

    set -A instance2 `ps -ef ¦ grep smo

    I get no errors from this code fragment. I suspect you wouldn't either. The cause of your error is in some other part of the script (k4[82]: syntax error at line 143 :). Please post the entire script. set -x param=$1 case ${param} in stop) set -A instance2 `ps -ef | grep [o]ra_smon |...

Part and Inventory Search

Back
Top