New to sed...
Have a file foo.txt (below).
Need to replace text on 2 lines, but can only feed sed the first few characters of each line (all lines are unique).
So, in my example, I have put '$' in place of what I need to figure out how to feed the whole line.
What I have thus far:
sed -e... (6 Replies)
hi guys,
insert into /*<new>*/abc_db.tbl_name
this is should be replaced to
insert into /*<new>*/${new}.tbl_name
it should use '.' as delimiter and replace
is there any way to do it using sed (6 Replies)
Lets say I have file.txt:
(Product:Price:QuantityAvailable) (: as delimiter)
Chocolate:5:5
Banana:33:3
I am doing a edit/update function.
I want to change the Quantity Available, so I tried using the SED command to replace 5, but my Price which is also 5 is changed instead.
(for the Banana... (13 Replies)
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hello All
I am struck in the issue which I want to share with all of you.
What I am trying to do is For every line in a file I have to replace a particular character from the given character in a file
For Example
Suppose the data is
1111x2222
1111x2222
2222y3333
1111x2222
I... (4 Replies)
I have a text file that looks like this:
-----------------------------------------
sta WP00
time 10/23/2013 20:10:17
sensor trillium_240_2 0 583
add
close sensor trillium_240_2 10/23/2013 20:10:17
sensor trillium_120 0 279
add
close sensor trillium_120 10/23/2013 20:10:35... (11 Replies)
I have a situation where a file "config.txt" looks like this
Servername:
OS:
Serername:
OS:
Servername:
OS:
....
....
...
Servername:
OS:
looking for the sed syntax to replace the "Nth" occurrence of Servername (i would apply the same logic to OS as well), want to replace the Nth... (4 Replies)
Hi Experts,
I have a file which contains a pattern multiple times i.e. matchthispattren. If a line is matched with this pattern. I want a number in 1234567890 to 123456789 in that line. (Basically remove the last digit from that number.
Please help.
Thanks,
Varun (1 Reply)
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
Discussion started by: cozzin
9 Replies
LEARN ABOUT DEBIAN
tracepath6
TRACEPATH(8) System Manager's Manual: iputils TRACEPATH(8)NAME
tracepath, tracepath6 - traces path to a network host discovering MTU along this path
SYNOPSIS
tracepath [-n] [-b] [-l pktlen] destination [port]
DESCRIPTION
It traces path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute,
only does not require superuser privileges and has no fancy options.
tracepath6 is good replacement for traceroute6 and classic example of application of Linux error queues. The situation with IPv4 is worse,
because commercial IP routers do not return enough information in icmp error messages. Probably, it will change, when they will be
updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history.
OPTIONS -n Print primarily IP addresses numerically.
-b Print both of host names and IP addresses.
-l Sets the initial packet length to pktlen instead of 65536 for tracepath or 128000 for tracepath6.
OUTPUT
root@mops:~ # tracepath6 3ffe:2400:0:109::2
1?: [LOCALHOST] pmtu 1500
1: dust.inr.ac.ru 0.411ms
2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480
2: 3ffe:2400:0:109::2 463.514ms reached
Resume: pmtu 1480 hops 2 back 2
The first column shows TTL of the probe, followed by colon. Usually value of TTL is obtained from reply from network, but sometimes reply
does not contain necessary information and we have to guess it. In this case the number is followed by ?.
The second column shows the network hop, which replied to the probe. It is either address of router or word [LOCALHOST], if the probe was
not sent to the network.
The rest of line shows miscellaneous information about path to the correspinding hetwork hop. As rule it contains value of RTT. Addition-
ally, it can show Path MTU, when it changes. If the path is asymmetric or the probe finishes before it reach prescribed hop, difference
between number of hops in forward and backward direction is shown following keyword async. This information is not reliable. F.e. the
third line shows asymmetry of 1, it is because the first probe with TTL of 2 was rejected at the first hop due to Path MTU Discovery.
The last line summarizes information about all the path to the destination, it shows detected Path MTU, amount of hops to the destination
and our guess about amount of hops from the destination to us, which can be different when the path is asymmetric.
SEE ALSO traceroute(8), traceroute6(8), ping(8).
AUTHOR
tracepath was written by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>.
SECURITY
No security issues.
This lapidary deserves to be elaborated. tracepath is not a privileged program, unlike traceroute, ping and other beasts of this kind.
tracepath may be executed by everyone who has some access to network, enough to send UDP datagrams to investigated destination using given
port.
AVAILABILITY
tracepath is part of iputils package and the latest versions are available in source form at http://www.skbuff.net/iputils/iputils-cur-
rent.tar.bz2.
iputils-101006 12 April 2011 TRACEPATH(8)