Search Results

Search: Posts Made By: sylaan
4,984
Posted By sylaan
That works, much thanks :)
That works, much thanks :)
4,984
Posted By sylaan
Yeah, forgot to mention that I tried the [1-22]...
Yeah, forgot to mention that I tried the [1-22] and it didn't work for me either. I am on a SunOS 5.10.

The sort command works, thanks for that. Unfortunately I will have to eventually parse very...
4,984
Posted By sylaan
Match a specific IP range
Hello all,

I would like a bit of help with a problem I am having. I have the following example file:

$ cat test_hosts
10.10.2.3 host1
10.10.2.4 host2
10.10.2.130 host3
10.10.2.5 host4...
39,547
Posted By sylaan
Thanks guys, I understand now why I can't have 2...
Thanks guys, I understand now why I can't have 2 pipes after a tail -f.



You are right, the loop shoud do the trick. However, that "print $i" prints each word on a new line. So I tried this...
39,547
Posted By sylaan
Nice, that works fine :-) Thanks. One more quick...
Nice, that works fine :-) Thanks. One more quick question: how would I print everything from the 7th field to the end of the line , in awk ? Something like cut's -f 7- .
39,547
Posted By sylaan
It was just an example to illustrate a real-world...
It was just an example to illustrate a real-world problem that I have.

Basically I need to tail a syslog file, grep for a certain pattern then display a certain field from the matched line. What...
39,547
Posted By sylaan
tail, grep and cut
Hello all,

I have some weird problem that kinda baffles me. Say I have the following test file:

claudia:~/tmp$ cat testfile.txt
This is a test line
This is the second test line
And yeah,...
9,716
Posted By sylaan
That works but I kinda need to use the \1, the IP...
That works but I kinda need to use the \1, the IP address that I matched. The lines I am going to parse will be syslog entries, which contain IP addresses. I just need to tail the syslog, pipe it...
9,716
Posted By sylaan
Ok, I just moved the first \( and now \1 is the...
Ok, I just moved the first \( and now \1 is the whole pattern, I can replace it and it works :) Thanks for your help so far.

Now I need to do something else. I actually need to replace the IP...
9,716
Posted By sylaan
I thought that is what's inside the (, ) but that...
I thought that is what's inside the (, ) but that does not encompasses the whole pattern.
9,716
Posted By sylaan
I think I got it, I need to remove the \1 at the...
I think I got it, I need to remove the \1 at the end.
9,716
Posted By sylaan
It seems to work, it replaces the first byte of...
It seems to work, it replaces the first byte of the IP:

server:~$ echo "This is an IP: 3.10.10.3" | sed -e "s/[0-9]\{1,3\}\(\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)/TEST\1/g"
This is an IP:...
9,716
Posted By sylaan
I just tried something simple first, like...
I just tried something simple first, like matching the first number and replacing it with some text:

server:~$ echo "This is an IP: 172.10.10.3 " | sed -e "s/([01]?\d\d)/TEST/g"
This is an IP:...
9,716
Posted By sylaan
sed on SunOS 5.10
Hello all,

I am having some problems using sed on a sunOS 5.10, I am using bash. For some reason the regexp I am trying to build is not working, even though it should.

I am trying to parse...
Showing results 1 to 14 of 14

 
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy