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 strongm 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 grazinggoat

  1. grazinggoat

    how is sed generating .2.

    Ahh ok totally saw my errors you pointed out. This works like a charm! thanks much!
  2. grazinggoat

    how is sed generating .2.

    I have files that are log.20170321PDT 8 numeric spaces and log.2017032307PDT 10 spaces the script does a conversion to add seconds to the time stamp to keep them unique when zipping but for some reason sed adds the extension below I'm at a loss on where the .2. is being genrated by sed any...
  3. grazinggoat

    regex to find invalid characters in filename

    Basically, I want filenames to be of the POSIX "Fully portable filenames" standard, which lists these: A–Z a–z 0–9 . _ - as acceptable in filenames everything else should be invalid.
  4. grazinggoat

    regex to find invalid characters in filename

    Hello Feherke, I want to be able to evaluate the FILENAME and if it see's anything in any position other than the "-", ".", number 0-9, or alph A-Z, to mark the filename as invalid. I thought the syntax for my regex would work but i get mixed returns I also tried ecsaping the "-" if [[...
  5. grazinggoat

    printing/echo variable issue

    I found the problem it was actually another line of code that was causing the variable to not populate. I'll def use tags going forward to make it easier to read. Thanks for replying SamBone!
  6. grazinggoat

    regex to find invalid characters in filename

    I am trying to move files that have invalid characters out of a directoy but the regex i am using is still copying the good files that i want to keep in the log_dir files can be like this bill-0001.log BILL-0120-.log Bill-A-1234-Nov.log The problem is those files are still being moved can...
  7. grazinggoat

    printing/echo variable issue

    Hello, I have a script written in korn shell that I am having trouble to read my variables into an http line that. I've tried placing "\" in from of the variables but when the script runs it doesn't add whats being read in. Can anyone suggest the proper way to get these 2 variables to...
  8. grazinggoat

    Help with character sort

    I have 30 various channele split into groups serv1g1s1 dbserv100g5s1 serv1g4s2 dbserv20g15s6 I want to be able to break the list down by the groups (ie g1s1, g4s2, g5s1, g15s6 ) how can i sort when there can be any number of characters before the g, inbetween the s? I only want the list to...
  9. grazinggoat

    help with understanding array

    Can someone explain why the array is being put back in itself? I don't understand why this needs to happen FILE_ARRAY[ $(( IDX )) ]="${FILE_ARRAY[ $(( IDX )) ]} ${FILE}" set -A FILE_ARRAY (( IDX = 0 )) ; (( COUNT = 0 )) for FILE in ${FILES} ; do...
  10. grazinggoat

    have awk grep 2 variables

    I actually thought i'd have to define each something like UP=0; DOWN=0; then pull them from the array but your way simplified this.
  11. grazinggoat

    have awk grep 2 variables

    both work! That later is what I was trying to pull out. I wasn't defining UP / DOWN on my attempts. thnx!
  12. grazinggoat

    have awk grep 2 variables

    I'm trying to parse the following I want to get a total of UP/DOWN from doing a status: apps_status sys1 UP sys2 UP sys3 DOWN sys4 UP right now I am doing app_status |awk 'NR>1 { r[$2]++ } END {for (i in r) print r[i], i}' how do i grep on up and down to feed into NR ? so that I have...
  13. grazinggoat

    case question

    i solved this... I wrapped the restart with an if restartll) if [[ ${COMMAND} = "restart" ]] then ${COMMAND}="stopall" sleep ${SLEEPTIME}...
  14. grazinggoat

    case question

    Looking for thoughts on good programming... in my case i want to be able to do both a stop and start with the restart call. is it wise to have my var RUNCMD for both calls ? case ${COMMAND} in stop) RUNCMD=stop ...
  15. grazinggoat

    output awk print horizontally

    ahhh.. understood "man printf" :) Appreciate ya!

Part and Inventory Search

Back
Top