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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. darkmuse

    AWK multiple variable assignment and search

    I tried this last one and it seems to work fine. Thanks for all the help. Randall
  2. darkmuse

    AWK multiple variable assignment and search

    Well, I tried it, and it will insert the -disconnect 09-19-02 for the correct username, but it isn't updating the dc.users.notfound correctly. Try it using these files: dc.users: bob steve mark users: tom Password = "xxxxx" steve Password =...
  3. darkmuse

    AWK multiple variable assignment and search

    I'll try the above in a test run... But to answer you question about what info goes in what file... The dc.user file only has the names of customers in the user file that need to be disconnected. dc.users : joe steve mark The users file is the actual radius file that our customers...
  4. darkmuse

    AWK multiple variable assignment and search

    I made the changes to the script. It now looks like this: BEGIN { myDomain=&quot;@mounet.com&quot; num = 0 while ((getline < &quot;dc.users&quot;) > 0) { nam[num] = $0 num++ } } { ATdomain=$1 myDomain for (j=0;j<num;j++) { if ( ($1 ~...
  5. darkmuse

    AWK multiple variable assignment and search

    Yep, that looks about like what i'm looking for.. One question though. Are the variables right in the modified script above? I would think it should look like this... Maybe i'm wrong. ... myDomain=&quot;@domain.com&quot; ... ATdomain=$1 myDomain for (j=0;j<num;j++) { if ( ($1 ~...
  6. darkmuse

    AWK multiple variable assignment and search

    I have this current script, that a few of you helped me get working a few weeks ago. Thanks everybody. Now I need to modify it to be a little more flexible. BEGIN { num = 0 while ((getline < &quot;dc.users&quot;) > 0) { nam[num] = $0 num++ } } { for (j=0;j<num;j++) {...
  7. darkmuse

    AWK search and replace

    That was it!!!! From all the people who've had to do this manually.. Thanks to everyone, very much. Randall
  8. darkmuse

    AWK search and replace

    Thanks CaKiwi. The script seems to work great except for one thing. It doesn't preserve the format of the original user file. I have saved the script in a file called automate. automate: BEGIN { num = 0 while ((getline < &quot;file.users&quot;) > 0) { nam[num] = $0 num++...
  9. darkmuse

    AWK search and replace

    Thanks again to everyone. I have one more question and hopefully i'll be finished. Taking the previous posting: awk -v name=bob -v date=`date +%m-%d-%y` ' { if ($1 ~ &quot;^&quot;name&quot;$&quot;) $4 = substr($4, 1, length($4)-1) &quot; discontinued &quot; date &quot;\&quot;&quot;; } {...
  10. darkmuse

    AWK search and replace

    Thanks to everyone for the help. Randall
  11. darkmuse

    AWK search and replace

    Thanks Ed. Thats a start, and that answers my question. The problem is, I didn't word my question correctly. :-) Let me try again... I need to open a file i'll call &quot;radius&quot; and do a line by line search the field $1 for a variable i'll call &quot;bob&quot; and append some text to...
  12. darkmuse

    AWK search and replace

    Hello all, I'm new to this site and have what I hope is a simple AWK problem... I need to search a file and add text to a line if the criteria is correct. If I have the following file: bob Password = &quot;password&quot; Service-Type=Framed-User Session-Timeout=9000...

Part and Inventory Search

Back
Top