Sponsored Content
Full Discussion: AWK/GREP sorting help
Top Forums Shell Programming and Scripting AWK/GREP sorting help Post 302444177 by methyl on Wednesday 11th of August 2010 06:00:48 AM
Old 08-11-2010
Please post the script which does the "traceroute" making it clear what Operating System you have and what Shell you are using.

The syntax for "traceroute" and the processing a "traceroute" output varies considerably. Many versions of the program output part of the output to STDOUT and part to STDERR.

The syntax for "awk", "sort" etc. also varies.
This User Gave Thanks to methyl For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep sorting/formatting

Hi, I currently have many log files for different webpages inside the folder /log/. The program allows the user to enter a month and then the grep function searches for it, the command i used is below: grep -c "$month" ./log/*.log This works and i can ascertain the number of matches, but I... (10 Replies)
Discussion started by: Jaken
10 Replies

2. Shell Programming and Scripting

awk sorting

Hi, I have used the following code to sort two sets of data: awk '{printf "%10s %s\n",$1,$2}' The first column is text and the second involves numbers. I was just wondering how i would go about sorting the second number so that they ascend from the top? Thanks for any help (4 Replies)
Discussion started by: Jaken
4 Replies

3. Shell Programming and Scripting

sorting in awk

i have following file have following type of data 1~%%~fcashfafh~%%~9797 can i sort(numeric) the file on first field and then on last feild using awk (3 Replies)
Discussion started by: mahabunta
3 Replies

4. Shell Programming and Scripting

Is there any better way for sorting in bash/awk

Hi, I have a file which is:- 1 6 4 8 2 3 2 1 9 3 2 1 3 3 5 6 3 1 4 9 7 8 2 3 I would like to sort from field $2 to field $6 for each of the line to:- 1 2 3 4 6 8 2 1 1 2 3 9 3 1 3 3 5 6 4 2 3 7 8 9 I came across this Arrays on example 26-6. But it is much complicated. I am... (7 Replies)
Discussion started by: ahjiefreak
7 Replies

5. Shell Programming and Scripting

Sorting with sed,awk ...

I need to sort this input using sed, awk or any other tool to give below output Input: RXOCF-8 CLASS 2A 57 RU 40 RXORX-8-0 CLASS 1B 23 45 16 RXORX-8-1 EXTERNAL CLASS 2A (12 Replies)
Discussion started by: aydj
12 Replies

6. Shell Programming and Scripting

Sorting inside awk

I have an array with five columns and i want to write it to a file. Before writing it i must sort it using the field in the fifth column. _________________________________________ |field 1|field 2|field 3|field 4|field 5| | | | | | | | | | |... (6 Replies)
Discussion started by: beatblaster666
6 Replies

7. Shell Programming and Scripting

Sorting a .csv using awk or other

Hello all, I am new here and *relatively* new to Unix. I have a bit of an emergency. I have a three column file that I need to sort: sample name, miRNA, reads per million (RPM) There are multiple samples, and for each sample name there are multiple miRNAs and associated RPMs. Some of these... (6 Replies)
Discussion started by: dunnybocter
6 Replies

8. Shell Programming and Scripting

Sorting within a record using AWK

Hello, I have a file which has the following format: I have to do is sort individual records in the file based on the 4th field. Each record starts with "Module". Is there an easy way to do this using awk. I have tried piping output from awk to sort and also using "sort" inside awk but... (8 Replies)
Discussion started by: fifteate
8 Replies

9. UNIX for Dummies Questions & Answers

GREP for sorting

Hi , I have a file which has a large number of sequences of type: gi_1 AASSKSKSKSSKSKSK.... series_121 DDKFKFKGKGKH gi_3 FFFFLFFLFLFLF series_1 DFFFFFF pattern_3 GEEEEEEEEE gi_2 HKKGGKGKGK series_102 HHHHH pattern_1 (2 Replies)
Discussion started by: siya@
2 Replies

10. Homework & Coursework Questions

Shell Script: Sorting by column using grep/awk

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: You will write a script that will read a tab-separated file that contains the names of all 50 states &... (7 Replies)
Discussion started by: tburns517
7 Replies
TRACEROUTE(1)						      General Commands Manual						     TRACEROUTE(1)

NAME
traceroute - print the route packets take to network host SYNOPSIS
traceroute [-46FInrRTV] [-f first_ttl] [-p port] [-m max_hops] [-N concurrent_hops] [-t tos] [-w timeout] [-q nqueries] [-S source_addr] [-i interface] [-g gateway] host [packetlen] traceroute6 [options] DESCRIPTION
traceroute tracks the route packets take across a TCP/IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host. traceroute6 is just another name for the same program, and is equivalent to invoking traceroute with the -6 option. Tracing with UDP The default mode of operation is to use UDP packets for path detection. This will send packets of a given size to a range of destination ports, usually in the high port range, and increment the destination port number for each probe packet sent). Intermediate gateways will return ICMP time exceeded errors when the packet's TTL reaches zero. When a packet reaches the remote host, and the chosen port is not in use, the host will return an ICMP port unreachable error. If the port is in use, the probe packet will be delivered to this port, more likely than not without eliciting a response. The port range is chosen so that it is rather unlikely that this port will be in use on the remote system. Tracing in UDP mode does not require super user privileges, as the Linux UDP implementation supports a so-called error queue, through which ICMP error packets related to a specific port can be delivered to the application. Tracing with ICMP In this mode, traceroute sends ICMP echo packets to the destination host, pretty much like the ping utility. ICMP tracing requires super user privilege, as it needs to open a raw socket to listen for incoming ICMP packets. Non-root users are not permitted to open such sockets for security reasons. ICMP traces are currently supported over IPv4 only. Tracing with TCP In TCP mode, traceroute will try to connect to the destination host. This causes the kernel to send a SYN packet to the remote host, again varying the TTL for each probe. The default port number used for TCP probes is 80 (http). When the probe reaches the destination host, it will either accept the connection (in case there's a service listening on this port), or respond with a TCP RST packet (in case there isn't). TCP tracing requires super user privilege, as it needs to open a raw socket to listen for incoming ICMP packets. Non-root users are not permitted to open such sockets for security reasons. ICMP traces are currently supported over IPv4 only. Caveats Many gateways are configured to limit the rate at which they will send ICMP error packets. Thus, when you run lots of traces in close suc- cession, an increasing number of gateways may "disappear", with probes timing out instead of eliciting an ICMP response. Rate limiting often happens at a granularity of 30 to 60 seconds, so do not expect things to work properly if you run more than two or three traces per minute. OPTIONS
The only required parameter is the name or IP address of the destination host. This parameter can be followed by the size of the probing packet sent to that host (40 by default). Varying the size of the packet in conjunction with the -F parameter can be used to obtain infor- mation about the MTU of individual network hops. This does not apply to TCP, which uses SYN packets to establish a path trace. Additional options are: -6, -4 Explicitly force IPv4 or IPv6 traceouting. By default, the program will try to resolve the name given, and choose the appropriate protocol automatically. If resolving a host name returns both IPv4 and IPv6 addresses, traceroute will use IPv4. Invoking the pro- gram as traceroute6 is the same as using the -6 option. -F Set the "Don't Fragment" bit. This tells intermediate routers not to fragment the packet when they find it's too big for a network hop's MTU. -f first_ttl Specifies with what TTL to start. Defaults to 1. -g gateway Tells traceroute to add an IP source routing option to the outgoing packet that tells the network to route the packet through the specified gateway. Not very useful, because most routers have disabled source routing for security reasons. -I Use ICMP ECHO instead of UDP packets when probing the route. This option is available to the super user only, as normal users do not have the privileges to create raw sockets. -i interface Specifies the interface through which to traceroute should send packets. By default, the interface is selected according to the routing table. NOTE: This option changed from previous versions of traceroute! Older versions used -I to specify the interface name. -m max_hops Specifies the maximum number of hops traceroute will probe. The default value is 30. -N concurrent_hops Specifies the number of probe packets sent out simultaneously. Sending several probes concurrently can speed up traceroute consid- erably. However, when specifying a number that's too large, the destination host will start to throw away random ICMP responses (if it implements ICMP rate throttling), and traceroute will be unable to detect the final hope reliably. The default value is 6. -n Do not try to map IP addresses to host names when displaying them. -p port Specifies the UDP destination port base traceroute will use. When sending its UDP probe packets, it will send them to port + hop - 1 for each hop. If there are ports in this range in use on the destination host, traceroute will not be able to identify reliably when it has reached the destination host (probes will appear to time out). The default port is 33434; you can use -p to change this to a different value. -q numqueries Sets the number of probe packets per hop. The default value is 3. -r Bypass the normal routing tables and send directly to a host on an attached network. If the host is not on a directly-attached net- work, an error is returned. This option can be used to ping a local host through an interface that has no route through it. -R Set the loose source route option on outgoing packets, asking intermediate routers to record their address as the packet passes. This can be useful if you want to find the address of an intermediate router that has been configured to not respond to traceroute packets. This feature hasn't been implemented yet. -S source_addr Chooses an alternative source address. Note that you must select the address of one of the interfaces. By default, the address of the outgoing interface is used. -T Use TCP instead of UDP packets when probing the route. This option is available to the super user only, as this requires a raw ICMP socket, which normal users are not permitted to create. -t tos Set the IP Type of Service (TOS) and Precedence value. Useful values are 16 (low delay) and 8 (high throughput). Note that in order to use some TOS precendence values, you have to be super user. -V Print the version and exit. -w sec Wait for sec seconds before sending the next probe packet. Note that unlike older traceroute versions, this implementation will transmit several probe packets in parallel, for different hop values. However, it will never send more than 1 packet per hop value at the same time. SEE ALSO
ping(8), netstat(8). AUTHOR
Concept and command line options based on the original LBL implementation of traceroute, written by Van Jacobson. This implentation is a complete rewrite and redesign, written and copyright (C) 2000-2008 Olaf Kirch <okir@suse.de>. 4.3 Berkeley Distribution 6 December 2000 TRACEROUTE(1)
All times are GMT -4. The time now is 07:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy