Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Building hierarchy with the list Post 303004605 by arunkumar_mca on Thursday 5th of October 2017 06:58:02 AM
Old 10-05-2017
Thanks. You mean to say I can make the below worked with -k4,4

Original
Code:
179341~1704489~1704480~704925680_TOTAL->MANUAL->TT IOR GSB
179341~1704497~1704480~775116444_TOTAL->POO TO->TT
179341~1704505~1704480~-572275295_TOTAL->MANUAL->MTO
179341~1704507~1704480~-611408278_TOTAL->PRIE LEL
179341~1704509~1704480~456690129_TOTAL->BTT TOO
179341~1704481~1704480~475919266_TOTAL->MANUAL->COM

Expected output

Code:
Code:
179341~1704489~1704480~704925680_TOTAL->MANUAL->TT IOR GSB
179341~1704505~1704480~-572275295_TOTAL->MANUAL->MTO
179341~1704481~1704480~475919266_TOTAL->MANUAL->COM
179341~1704497~1704480~775116444_TOTAL->POO TO->TT
179341~1704507~1704480~-611408278_TOTAL->PRIE LEL
179341~1704509~1704480~456690129_TOTAL->BTT TOO

Output after execution. Not sure how can traverse through the ~ delimiter and sort the whole record
Code:
sort -t">" -k4,4  ttt
179341~1704481~1704480~475919266_TOTAL->MANUAL->COM
179341~1704497~1704480~775116444_TOTAL->POO TO->TT
179341~1704505~1704480~-572275295_TOTAL->MANUAL->MTO
179341~1704507~1704480~-611408278_TOTAL->PRIE LEL
179341~1704509~1704480~456690129_TOTAL->BTT TOO

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to archive certain folders in a hierarchy

I'm new to shell scripting and I'm having a tough time figuring out how to script something. Can anyone help? Here is my setup and what I want to do: A directory contains a list of projects by year (2000, 2001, etc) and customers (01-001) all of which have the same internal directory setup... (3 Replies)
Discussion started by: medazinol
3 Replies

2. UNIX for Dummies Questions & Answers

cp without maintaining the soucre directory tree hierarchy

Hi guys. I'm willing to copy a specific file system hierarchy, but I would not like to maintain the directory tree organization. For example: Let's say /a/b/c is the fs I'm wanting to copy to my destination, and that c is a directory with 30 files, 10 on /a/b/c , 10 on a/b/c/c1 and 10... (2 Replies)
Discussion started by: 435 Gavea
2 Replies

3. Tips and Tutorials

Linux Filesystem Hierarchy

Hi, Please have a look this: http://tldp.org/LDP/Linux-Filesystem-Hierarchy/Linux-Filesystem-Hierarchy.pdf I think this can be very useful for a beginner/intermediate level user to understand the filesystem hierarchy and as well as it can be used as a reference to various linux commands and... (0 Replies)
Discussion started by: tayyabq8
0 Replies

4. Solaris

Why are so many dirs used in solaris hierarchy?

Hi all, I would like to know the difference between the different dir structures present in solaris!!! Meaning what does /usr contain, /etc ,/opt/ ,so on... I know what /usr and /etc are used for. But why are /opt /bin /sbin /var and many more that i have missed I would appreciate if... (1 Reply)
Discussion started by: wrapster
1 Replies

5. Shell Programming and Scripting

Script calling hierarchy

If a.sh calls b.sh, how can we know inside b.sh that it was called by a.sh? (4 Replies)
Discussion started by: chaitu_inmage
4 Replies

6. Shell Programming and Scripting

building table from list

Hi, I have a file with the following structure M17XX-050-01-001 1100000000 A16 1.341E+05 ... B18 3.084E+02 total 1.344E+05 XY35 5.694E+03 ... XY241 6.725E+02 total 9.897E+05 Wr81Z 5.195E+00 ... Wr91Z 1.029E+02 Wr92Z 1.285E+02 total 9.897E+05 M17XX-050-01-001 1010000000... (2 Replies)
Discussion started by: f_o_555
2 Replies

7. UNIX for Advanced & Expert Users

Rsync building file list/catalog path/location

Where is the file list created by rsync when it says building file list ? (1 Reply)
Discussion started by: glev2005
1 Replies

8. Programming

DB2 Query to pick hierarchy values

Dear Team I am using DB2 v9 . I have a condition to check roles based on hierarchies like below example. 1.Ramesh has Roles as "Manager" and "Interviewer" 2.KITS has Roles as "Interviewer" 3.ANAND has Roles as "Manager" and "Interviewer" select * FROM TESTING NAME ... (6 Replies)
Discussion started by: Perlbaby
6 Replies
IPCONFIG(8)						    BSD System Manager's Manual 					       IPCONFIG(8)

NAME
ipconfig -- view and control IP configuration state SYNOPSIS
ipconfig waitall ipconfig getifaddr interface-name ipconfig ifcount ipconfig getoption interface-name (option-name | option-code) ipconfig getpacket interface-name ipconfig getv6packet interface-name ipconfig setverbose level ipconfig set interface-name NONE ipconfig set interface-name (DHCP | BOOTP) ipconfig set interface-name (MANUAL | INFORM) ip-address subnet-mask ipconfig set interface-name NONE-V6 ipconfig set interface-name AUTOMATIC-V6 ipconfig set interface-name MANUAL-V6 ipv6-address prefix-length ipconfig set interface-name 6TO4 DESCRIPTION
ipconfig is a utility that communicates with the IPConfiguration agent to retrieve and set IP configuration parameters. It should only be used in a test and debug context. Using it for any other purpose is strongly discouraged. Public API's in the SystemConfiguration framework are currently the only supported way to access and control the state of IPConfiguration. The IPConfiguration agent is responsible for configuring and managing the IP addresses on direct, connectionless interfaces such as IEEE 802.3 Ethernet and IEEE 1394 FireWire. The IPConfiguration agent is a program bundle that is loaded and executed by the configd(8) process. The IPConfiguration agent implements the client side of the DHCP and BOOTP protocols described in RFC951, RFC1542, RFC2131, and RFC2132. It also assigns and maintains static IP addresses. It may also allocate and assign a link-local IP address if DHCP fails to acquire an IP address. In all cases, the IPConfiguration agent performs IP address conflict detection before assigning an IP address to an interface. COMMANDS
The ipconfig utility provides several commands: waitall Blocks until all network services have completed configuring, or have timed out in the process of configuring. This is only use- ful for initial system start-up time synchronization for legacy network services that are incapable of dealing with dynamic net- work configuration changes. getifaddr interface-name Prints to standard output the IP address for the first network service associated with the given interface. The output will be empty if no service is currently configured or active on the interface. ifcount Prints the number of interfaces that IPConfiguration is capable of configuring. The value that's printed will not change unless relevant network interfaces are either added to or removed from the system. getoption interface-name (option-name | option-code) Prints the BOOTP/DHCP option with the given name or option code integer value. See bootpd(8) for option code names. If an option has multiple values e.g. domain_name_server, only the first value is printed. getpacket interface-name Prints to standard output the DHCP/BOOTP packet that the client accepted from the DHCP/BOOTP server. This command is useful to check what the server provided, and whether the values are sensible. This command outputs nothing if DHCP/BOOTP is not active on the interface, or the attempt to acquire an IP address was unsuccessful. getv6packet interface-name Prints to standard output the latest DHCPv6 packet that the client accepted from the DHCPv6 server. In the case of stateful DHCPv6, it corresponds to the last packet from the server that contained addressing information. This command is useful to check what the server provided, and whether the values are sensible. This command outputs nothing if DHCPv6 is not active on the interface. set interface-name NONE set interface-name (DHCP | BOOTP) set interface-name (MANUAL | INFORM) ip-address subnet-mask set interface-name NONE-V6 set interface-name AUTOMATIC-V6 set interface-name MANUAL-V6 ipv6-address prefix-length set interface-name 6TO4 Sets the interface to have a new temporary network service of the given type. Any existing services on the interface for the particular protocol (IPv4 or IPv6) are first de-configured before the new service is instantiated. If NONE is specified, all existing IPv4 services are de-configured. If NONE-V6 is specified, all existing IPv6 services are de- configured. DHCP and BOOTP require no additional arguments. The IP address, subnet mask, router, and DNS information are retrieved automati- cally. Both MANUAL and INFORM require the specification of an IP address ip-address and a subnet mask subnet-mask. The INFORM service configures the IP address statically like MANUAL, but then broadcasts DHCP INFORM packets to retrieve DHCP option information. If the DHCP server responds and supplies a subnet mask, that subnet mask is used instead of the specified subnet-mask. AUTOMATIC-V6 requires no additional arguments. The IPv6 address, prefix length and router are retrieved automatically. MANUAL-V6 requires the specification of the IPv6 address ipv6-address and a prefix length prefix-length. 6TO4 only works on Six To Four (IFT_STF) interfaces e.g. stf0. If it is specified on a non-IFT_STF interface, it has the same effect as specifying NONE-V6. The set command requires root privileges. Note: The set command is very useful for debugging, but it can't be used to configure a persistent service. The temporary ser- vices that are created only remain until the next network configuration change occurs. See scselect(8). setverbose level Enables or disables verbose mode logging in the IPConfiguration agent. Specify a level value of 0 to disable verbose logging, the default. Specify a value of 1 to enable verbose logging. This setting is persistent across boots of the operating system. When enabled, verbose log files are generated in the directory /Library/Logs/CrashReporter. The filenames follow the naming con- vention com.apple.networking.IPConfiguration.log.<timestamp>. The setverbose command requires root privileges. EXAMPLES
# ipconfig getpacket en0 op = BOOTREPLY htype = 1 dp_flags = 0 hlen = 6 hops = 0 xid = 1956115059 secs = 0 ciaddr = 0.0.0.0 yiaddr = 192.168.4.10 siaddr = 192.168.4.1 giaddr = 0.0.0.0 chaddr = 0:3:93:7a:d7:5c sname = dhcp.mycompany.net file = options: Options count is 10 dhcp_message_type (uint8): ACK 0x5 server_identifier (ip): 192.168.4.1 lease_time (uint32): 0x164a subnet_mask (ip): 255.255.255.0 router (ip_mult): {192.168.4.1} domain_name_server (ip_mult): {192.168.4.1} domain_name (string): mycompany.net end (none): # ipconfig getoption en0 router 192.168.4.1 SEE ALSO
configd(8), bootpd(8), scselect(8) HISTORY
The ipconfig command first appeared in Mac OS X Version 10.0 Public Beta. Mac OS X March 27, 2013 Mac OS X
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy