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 with a hostname. I have a small script that does this but I am not sure how to pass the \1 to my script, inside the sed statement.
Normally the script does this:
The res script is just a simple grep script:
But when I try to integrate it into the sed line, I get this:
The grep inside "res" does not like the \1, which I kinda understand. Thing is, if I do a simple echo "\1" instead of the res "\1" then it works, the \1 is replaced with the actual IP from the sed statement.
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 through the sed statement and replace the IP address with its equivalent hostname (which I get via the small res script).
Hi
I probably dont have GNU extended sed in my SUNOS . and its creating lot of problems
ex:
a simple sed command like this is not working
sed '/WORD/ a\
sample text line 1 \
sample text line 1
' filename
sed: command garbled: /WORD/ a
I took precaution to have a new line after... (11 Replies)
Why does the below command doesnt work fine on SunOS 5.10
$ cat t
| AK| | | | | DS | | | | tAR | | | | | FIL |
$ sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ *| */|/g' t
|AK|||||DS|||| tAR|||||FIL|
##notice before tAR
works fine on Linux OR AIX though
... (8 Replies)
Hi,
I called Sun and they said they no longer sell SunOS 5.6. I desperately need a CD-ROM of the install CD to perform maintenance work on a server.
Does anyone know where to get one or know someone who can make me a copy? (2 Replies)
Hi,
I am bulding a path to open files like this \path\values\file.xxx This path is opened in an IE browser window and opens the file/document I am trying to see. I mean it opens a pdf document or it promps you to "save" or "open" the specific file (if it's a .xml, .doc, .html).
I was using... (1 Reply)
...and I'm having an issue with memory usage. I got an alert from our sun management console that the box is at 90% memory usage. I need to know what's eating up the memory as this particular box has 16GB of RAM. (3 Replies)
Hi folks
I have a small problem wherein i have to obtain the data for the last 5 minutes from a logfile. I need to schedule this script in the crontab so that it runs every 5 minutes. A sample of the data is as shown
The first field is the hour, second the minute, third field is msg... (3 Replies)
Hey all,
I've got my hands on 10 SunOS 5.6 SPARCStation 20 machines and I'm looking to get them up and running. They're all in various states of disrepair but I've got them all to a state where the hardware is working and the machine will at least attempt to boot.
I've only used Solaris as a... (1 Reply)
Hi,
I Hope you can help me with my problem.
I need to have an installation CD of this version.
Is there any site you can recommend that I can download
an image of this OS?
Thanks and God Bless!!! (6 Replies)
I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
I am loging into a SunOS 5.8 box for the first time.
I do not see a .profile file in the home directory. Also on the command line when I type a backspace to correct my typing I get a ^H character. Where and how can I fix this?
Thanks in advance (5 Replies)