Sponsored Content
Top Forums Shell Programming and Scripting sed make me headache... need help! Post 68916 by nymus7 on Friday 8th of April 2005 10:35:48 AM
Old 04-08-2005
sed make me headache... need help!

I've still a little problem with sed.
So, the content of my file.txt is like:

101.10.20.2.1079 > 101.11.2.20.80:
101.10.20.2.1080 > 101.11.2.20.80:
101.10.20.2.1081 > 101.10.20.2..80:
101.05.15.143.1068 > tpo68-96-22-1.no.no.cox.net.4391:
101.05.15.143.1072 > bzq-130-119-40.pop.bezeqint.com.23373:
101.05.15.143.1073 > dhcp024-320-77-020.woh.rr.gr.32341:
server.2391 > 200.19.2.10.telnet:
server.2391 > google.com.www:
server.writesrv > 200.19.10.2.ssh:
server.xinuexpansion > gregor.ngu.com.www:

And i want only to delete the port, like so:

101.10.20.2 > 101.11.2.20
101.10.20.2 > 101.11.2.20
101.10.20.2 > 101.10.20.2
101.05.15.143 > tpo68-96-22-1.no.no.cox.net
101.05.15.143 > bzq-130-119-40.pop.bezeqint.com
101.05.15.143 > dhcp024-320-77-020.woh.rr.gr
server > 200.19.2.10
server > google.com
server > 200.19.10.2
server > gregor.ngu.com

Delete the ip address is easy but only the port is hard...
sed 's/\.*> //' file.txt
I don't see how to do that!
Has someone an idea?

Thankx
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extremely headache

I need to execute command at remote host from my program. there is rs6000/aix standard command called rexec. unfortunately rexec ask username and password which must supplied interactively, of course it is impossible runned by program. So I have to change rexec command format to make user-name... (5 Replies)
Discussion started by: yatno
5 Replies

2. IP Networking

DHCP client & ipchains headache

Hi all, I upgraded my SUSE 6.1 to SUSE 7.1 and at once the following things won't work anymore: 1) My DHCP client is not able anymore to retrieve my IP address from the @home server. It times out all the time. If I use a fixed IP I can get on the net, so there is no physical problem. 2) I... (3 Replies)
Discussion started by: Micky
3 Replies

3. Solaris

A very headache problem

guys, need your help~~~~ I am setting up a Sun Enterprise 450 Ultra 4 server originally I was using Sun solaris 9 1202 version. but after an accident (i guess becoz i deleted something wrongly), the system cannot boot up. and now I wana install a FreeBSD(since it is free and it will... (3 Replies)
Discussion started by: MrDJay
3 Replies

4. Shell Programming and Scripting

Make sed ignore lines

Hi I use sed in a script for severall changes in files. I whish one of the substitutions I made to be aplied to every line that has the word "scripts" with the exception for the ones that start with "rsh", wich I wish sed to ignore . Is this possible? If yes, how can I do it? The substitution... (2 Replies)
Discussion started by: Scarlos
2 Replies

5. UNIX for Dummies Questions & Answers

sed headache

Hi all, I've got a thorny sed/regex problem and I thought somebody out there might be able to help. I'd like to use sed in a Makefile to parse a path string. The path might look like this: case 1: /mnt/users/bob/build/src or case 2: /mnt/users/bob/build/src/foo or case 3: ... (4 Replies)
Discussion started by: gnarl
4 Replies

6. Shell Programming and Scripting

scripting headache... loops & variables

Surely there's an easier way to do this, lets see if anyone knows! I am new to scripting so go easy on me! I have the following script and at the moment it doesn't work and I believe the problem is that I am using a while loop within a while loop. When I run the script using sh -x I can see... (6 Replies)
Discussion started by: StevePace
6 Replies

7. Shell Programming and Scripting

Friday afternoon headache

Hi all, It's been a long week and my brain is clearly not functioning right so hopefully someone can help me out here. I've got a function in a script which just checks if a MySQL database directory exists or not. Code is as follows: dbCheck2() { if ; then { : # carry... (4 Replies)
Discussion started by: _Spare_Ribs_
4 Replies

8. UNIX for Dummies Questions & Answers

formatting a file headache

Hello does anyone know how to do the following using some simple unix if possible: I have a file with the following info as comma separated. It shows username, id number and all the subjects they are enrolled in on the one line. The subjects are separated by colons. UserName,ID,Subject... (13 Replies)
Discussion started by: ynneycat
13 Replies

9. UNIX for Advanced & Expert Users

ssh command headache

Good day, I am trying to run a ssh command on a remote server, but when I run the command the server takes FOREVER... and ends up giving me an error.. then the script also kicks server load up by 100% while it is running.. But if I run the same command on the server it goes pretty quickly and... (3 Replies)
Discussion started by: msullivan
3 Replies

10. Shell Programming and Scripting

Beginner: script headache

Hi, I am new to shell scripting, but doing my best to learn things. Today doing courses there was exercise like this: #!/usr/bin/bash a=$1 b=$2 if ] then echo "Conditions are met" else echo "Conditions are not met" fi I improved it a little, beacuse of curiosity :D to this: ... (8 Replies)
Discussion started by: Rosentine
8 Replies
Net::SIP::DTMF(3pm)					User Contributed Perl Documentation				       Net::SIP::DTMF(3pm)

NAME
Net::SIP::DTMF - DTMF RTP packet generating and extracting SYNOPSIS
use Net::SIP::DTMF; my $sub = dtmf_generator( 11, # event '#' 100, # duration 100ms rfc2833_type => 101, # RTP type 101 for telephone-event/8000 # audio_type => 0, # RTP type 0 for PCMU/8000 ); while (...) { my @pkt = $sub->($sequence,$timestamp,$srcid); last if ! @pkt; # dtmf done next if $buf[0] eq ''; # more coming, but no data this time (pause) .. send @pkts ... } use Net::SIP::DTMF; my $sub = dtmf_extractor( rfc2833_type => 101, # RTP type 101 for telephone-event/8000 audio_type => 0, # RTP type 0 for PCMU/8000 ); while (...) { if ( my ($event,$duration,$type) = $sub->($packet)) { # event received ... } } DESCRIPTION
This package provides functions for generating RTP packets containing DTMF events or extracting DTMF events from RTP packets. FUNCTIONS
dtmf_generator ( EVENT, DURATION, %ARGS ) Generates a function which is used to generate packets for the given EVENT. EVENT is the event numer (0..15) or undef if it should just generate silence or pause. DURATION is the time for the event in ms. ARGS contain information how the event should be packed: either as RFC2833 RTP event or as RTP audio PCMU/8000. %ARGS can be rfc2833_type => rtp_type Gives the RTP payload type number for rfc2833 RTP events (telephone-event/8000). If not given will try audio_type instead. audio_type => rtp_type Gives the RTP payload type number for PCMU/8000. If not given and no rfc2833_type given it will croak. volume => volume Sets the volume for RTP event according to rfc2833. The generated function should then be called with SEQUENCE,TIMESTAMP,SRCID to generate the RTP packets and will return @RTP_PACKETS, with () - DTMF event is finished $RTP_PACKETS[0] eq '' - no RTP packet for this call (pause) @RTP_PACKETS - RTP packets which can be send to the peer dtmf_extractor ( %ARGS ) Generates a function which is used to extract DTMF events. Keys rfc2833_type and audio_type have the same meaning as in generate_dtmf. It will only attempt to extract DTMF events from rfc2833 RTP events or audio if the relevant rtp_type is given. The function will be called with the RTP packet as the only argument and will return () if no new events where found or (EVENT,DURATION,TYPE) if an event finished, where DURATION is the duration in ms and TYPE is audio|rfc2833. For performance reasons it is best to use only rfc2833 if the peer supports it. perl v5.14.2 2012-06-12 Net::SIP::DTMF(3pm)
All times are GMT -4. The time now is 07:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy