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 Chriss Miller 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: *

  • Users: segment
  • Content: Threads
  • Order by date
  1. segment

    Awk time sum

    Hey all (long time), have a file with the following on each line (file is 10,000,000 lines per day): "7605551212","17045551212","8665551212","context","17045551212","SIP/5060-f5dd3250","","Context","17045551212","2008-10-08 07:46:41","2008-10-08 07:46:41","2008-10-08...
  2. segment

    difficulties on AWK parsing/passing/variables

    Hey all, need some assistance on this one. Greets to all and thanks in advance (long time no post)... So I have the following in a file term permit_database_access { from { source-address { aaa.aaa.aaa.aaa/32; bbb.bbb.bbb.bbb/32...
  3. segment

    Windows 2003 w/ISA VPN question

    Hey all, I've run into the following issue and was wondering if someone had set something like this up. If so would you be willing to provide the details... In order to avoid writing a paragraph, please see this diagram: http://www.infiltrated.net/isaquestion.jpg Any tips or pointers are...
  4. segment

    Quick lab hint

    Hey all, I'm currently configuring the following for a HOME CC* lab: 2 2612 Routers W/WIC-1T, (16F/64D (both)), Catalyst 5505 WS-X5530-E3A, ATM Dual MMF, 1 Pix 1 3640, 2 2501's... Any hints on what I might be missing? I figure I could snag a 29xx catalyst if necessary... Anyhow I'm planning on...
  5. segment

    Sanitizing a column

    Alright all. (greets for the week). I have a question on sanitizing... I have the following script looking at /var/log/secure (sometimes /var/log/authlog) awk '!/invalid user/&&!/#/&& /\./&& !a[$0]++ {print "iptables -A INPUT -s "$13" -i eth0 -d eth0 -p TCP --dport 22 -j REJECT"}'...
  6. segment

    Using a variable inside of a function with awk...

    bash function inside of an awk statement... So I created a function called IPT ... function IPT { cat /etc/hosts.deny|\ awk '!/#/ && /./ && ! a[$0]++ {print "iptables -A INPUT -s "$1" -i eth0 -d xxx.xxx.xxx.xxx -p TCP --dport 22 -j REJECT"}'|\ awk '/iptables/ && !/#/ && !/-s -i/'|sh }...
  7. segment

    escaping '

    $ awk '{print "'"}' > -bash2-2.05b$ awk '{print "\'"}' > -bash2-2.05b$ awk '{print ".'"}' > -bash2-2.05b$ awk '{print ".\'"}' > How am I escaping the ' character? I need to print a statement that contains the following: awk '/403/ && /Request/{print "perl -pi -e 's/logged/"$3" logged/g'"}'...
  8. segment

    piping in awk

    no piping allowed Alright, so a quick question about piping in awk... awk 'a !~ $0; {a=$0}' (equivalent to uniq) awk '! a[$0]++' (equivalent to uniq) awk '/something/' (equivalent to grep something) awk '!/something/' (equivalent to grep -v something) So now I have a cdr file... Its normal...
  9. segment

    Multipie file comparison and replacement

    Paste... Awk... Perl... Bash... Stumped on this I have two files (Asterisk) File one: [1234] type=friend username=1234 secret=1234 host=dynamic context=admin mailbox=1234@anywhere callerid="Anywhere" <1234> nat=no File two: 1234 Somewhere I need to ensure that entries in file_one match...
  10. segment

    Omitting certain columns

    I have a line sometimes it has 10 columns sometimes it can go to 30 columns... I need everything except fields 3, 4 and 5. Couldn't find an exisiting solution in these archives nor googling... Thanks perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
  11. segment

    First fields only

    Hey all, I have a file something like this... 1:2:3:4:5:6:7:8 I want to be able to either replace 1 using awk or sed awk -F ":" '{print "new_value",$2,$3,$4,$5,$6,$7,$8}' where the colons are retained. new_value:2:3:4:5:6:7:8 Shortcut? perl -e 'print...
  12. segment

    Replace 1st field leave all others alone

    Hey all (reposting this). I have 4500+ files all close to being the same they're all 27 lines long. I'm trying to do an inplace edit for one variable but I can't seem to finesse it... I have the following line inside every file 238 INVITE sip:$user@$server SIP/2.0\r The number 238 is always...
  13. segment

    all inclusive replacement

    Hey all. I have 4500+ files all close to being the same. I'm trying to do an inplace edit for one variable but I can't seem to finesse it... I have the following line inside every file 238 SOMETHING email:somewhere@someplace.com MAIL/4.2\r The number 238 is always changing and I need to...
  14. segment

    Bad bad DMZ

    I have 2 2000 Windows servers spitting DNS (1 primary, 1 secondary), created a Windows 2003 server (DMZ) that I'm trying to connect to the 2000 servers. I get an error to the tune of "Cannot generate trust" or so. Any ideas on where to look? I can ping from the 2003 to the 2000's and vice...
  15. segment

    Printing based on following field

    Hey all something got me stumped... I have a list of about 200 mac addresses in 0004F2061276 format. I need to enter the colon between: 00:04:F2:06:12:76 tried looking for everything but came up empty perl -e 'print $i=pack(c5,(40*2),sqrt(7600),(unpack(c,Q)-3+1+3+3-7),oct(104),10,oct(101));'
  16. segment

    near real time if script

    Hey all, need advice on something... Have machine A and machine B. Both have to monitor a specific term and react. Its being run from cron (*/1 * * * * /run/this/command)... Machine B needs to tail -f /var/log/messages for the field "is dead" then react: tail -f /var/log/messages|grep "is...
  17. segment

    Forms, arguments, etc

    Hey all, I'm looking to make a quick (good looks not necessary) form which will take my argument and parse it out of a logfile, then print it back to the page I entered the command on... Think of grep 20060925 /var/log/messages where in a little form I can enter the date. However, boolean grep...
  18. segment

    Form justification...

    Form justification... Ive got the following table created and am trying to get it all to align properly... I though colspan and rowspan would do it but its not.. It prints as: Field 1: ________ Field 2: ________ Field 3: _____ Field 4: ___ Field 5: __ Field 6: _____ Field 7: _____ Trying to...
  19. segment

    Printing query

    I created a db query which works fine: $db = new mysqldb("sample","root","","localhost"); $res2 = $db->query("SELECT b.id, c.fname, c.lname, c.creditcard, c.creditname, c.creditexprmonth, c.creditexpyear, c.creditccv, bint.description...
  20. segment

    Numbering with a Sum...

    I have a file with 106 entries on it most look like this: 1 25 34 36 42 I want to be able to number each line (this is easy awk 'NF{$0=++a " :" $0};{print}') but I'd like to add the sum of all numbers at the end so eg the entry would look like (normally awk '{s=0; for (i=1; i<=NF; i++)...

Part and Inventory Search

Back
Top