Sponsored Content
Top Forums Shell Programming and Scripting Help needed regarding first 3 items in the list Post 302423930 by pseudocoder on Sunday 23rd of May 2010 01:43:16 PM
Old 05-23-2010
Code:
$ awk '{print $1}' infile | uniq | while read line; do
grep -m3 "^$line" infile && echo
done

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change list to comma seperated items

I have a list of servers in a file called serverlist like this server1 server2 server3 i need to have them (with no trailing comma, the program does not like that) server1,server2,server3 so far i have been using HOSTS=/tmp/serverlist HOSTS=${HOSTS:-$(grep -Ev "^#|^$"... (2 Replies)
Discussion started by: insania
2 Replies

2. Shell Programming and Scripting

awk between items including items

OS=HP-UX ksh The following works, except I want to include the <start> and <end> in the output. awk -F '<start>' 'BEGIN{RS="<end>"; OFS="\n"; ORS=""} {print $2} somefile.log' The following work in bash but not in ksh sed -n '/^<start>/,/^<end>/{/LABEL$/!p}' somefile.log (4 Replies)
Discussion started by: Ikon
4 Replies

3. Shell Programming and Scripting

Shell Script Needed to Read a text from a list files

Hi, Below is my issue which I desperately need and I want a shell script which can do this job. I need this script as I m planning to put this for a system health check. Please assist me. 1. There are 10 log files in a particular location. 2. open each log file. Goto to the end of the... (4 Replies)
Discussion started by: kashriram
4 Replies

4. Web Development

List items not arranged as expected on web page

greetings, i have a list of items that are picks to be arranged within a row that is 22 in height. this "plugin" looks fine in the old installation but after installing a new version of the web app and dropping this "plugin" in place the layout isn't as i expect. they are arranged vertically... (1 Reply)
Discussion started by: crimso
1 Replies

5. Shell Programming and Scripting

Parsing through a list of items

Hi there, Here is my checklist of items, 4.1.1 Alerter 4.1.2 Client Services for Netware 4.1.3 Clipbook 4.1.4 Fax Service 4.1.5 File Replication 4.1.6 File Services for Macintosh 4.1.7 FTP Publishing Service 4.1.8 Help and Support 4.1.9 HTTP SSL 4.1.10 IIS Admin Service ... (1 Reply)
Discussion started by: alvinoo
1 Replies

6. Shell Programming and Scripting

Read a lis, find items in a file from the list, change each item

Hello, I have some tab delimited text data, file: final_temp1 aname val NAME;r'(1,) 3.28584 r'(2,)<tab> NAME;r'(3,) 6.13003 NAME;r'(4,) 4.18037 r'(5,)<tab> You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

7. What is on Your Mind?

Number of Small Forum Code Changes (TODO List Items)

In the past few days have I have done a lot of code cleanup work in various categories, including faster page loading and bug fixes: Move countless inline style directives to external CSS stylesheets for key pages (faster page loading) Fixed bug in member panel going between desktop and... (6 Replies)
Discussion started by: Neo
6 Replies

8. Shell Programming and Scripting

Pass an array to awk to sequentially look for a list of items in a file

Hello, I need to collect some statistical results from a series of files that are being generated by other software. The files are tab delimited. There are 4 different sets of statistics in each file where there is a line indicating what the statistic set is, followed by 5 lines of values. It... (8 Replies)
Discussion started by: LMHmedchem
8 Replies

9. Shell Programming and Scripting

Script to process a list of items and uncomment lines with that item in a second file

Hello, I have a src code file where I need to uncomment many lines. The lines I need to uncomment look like, C CALL l_r(DESNAME,DESOUT, 'Gmax', ESH(10), NO_APP, JJ) The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL".... (7 Replies)
Discussion started by: LMHmedchem
7 Replies
mipconfig(1M)															     mipconfig(1M)

NAME
mipconfig - Mobile IPv4 Mobility Agent configuration utility SYNOPSIS
[ conf_file ] display_file ] DESCRIPTION
is a configuration tool for Mobile IPv4 Mobility Agent daemon, mipd(1M). The tool gathers data from the user and generates configuration files formatted specifically for Only root user can run Options recognizes the following command-line options and arguments: conf_file This will start a configuration session. If conf_file is not provided, is used as default. If the target file exists, then its contents will be read and stored in the session records. The process of reading the file is similar to the option (non-fatal errors will be flagged and fatal errors will cause immediate termination of the process). If the file does not exist, session records are initialized to zero and the user can create a new file from scratch. Note that specifying conf_file does not necessarily imply that the file will be modified; the user will have to explicitly commit session records. The user can specify any file name at that time. Displays the contents of a configuration file. If a file is not specified, the contents of are displayed (if the file exists). informs the user of any syntax or data type errors in the file. Fatal errors will cause immediate termination of the reading process and all data read up to this point will be displayed to the user. The tool restricts the size of each line of the file to 250 characters and the maximum length of any non-commented token to 60 characters. Commands sessions support the following commands. For commands that take arguments, user can input arguments in the novice mode by entering the command name without any arguments. In novice mode, user can get help for any input by typing in "?" at the prompt. commands can be classified into three categories. Users are required to input values for command arguments unless the descriptions state when input is not required or describe the default behavior of when the information is not configured. can be configured to operate in two modes: 'normal' and 'AAA-mode'. The command can be used to configure mipd to operate in one of above modes. Command usage is predicated on the most recently configured operating mode. Unless specified, a command can be used in all four configura- tion types. Some commands have different usages based on the current configuration. The descriptions clearly indicate the different usages of the command. Configuration Commands These commands are of the form: and The commands can be used to configure or update individual sets of information (for example, a Mobile node). The commands can be used to delete one or more sets of information (for example, all interfaces). The input can be used to delete individual information for a set of information (for example, Global Information). (Abbr.: Configure or update global parameters. The following parameters are currently supported: Time period that the FA should hold registration requests that have not been replied to. This value is in seconds and can be floating point. If no value is specified, will use 5.0. Code used in the ICMP code field of router advertisements. This agent supports common IP traffic in addition to Mobile IP traffic. This may cause non-Mobile IPv4 clients to attempt to use the information in the Mobile IPv4 advertise- ments. This agent supports Mobile IP traffic but not common IP traffic. Only Mobile IPv4 clients should use the information in the Mobile IPv4 advertisements. If no value is configured, the MIP daemon will use 16 (no common traffic). This is appropriate for most topolo- gies. The Fully Qualified Domain Name of the AAA server for This input is required for to operate in AAA-mode. The input must be verifiable via a DNS lookup. The Fully Qualified Domain Name of host. This input is required for to operate in AAA-mode. The input must be verifiable via a DNS lookup. The port on the AAA server to which should connect when operating in AAA-mode. This input is optional. If no value is specified, will use 1812. (Abbr.: Configure or update an interface on which mobility services will be offered. name Name of interface (maximum 16 characters) on which Mobility Agent services will be offered. Users will be warned if interface is not on the machine (UP, not POINTOPOINT or LOOPBACK). Services provided on the interface. An input of "HA" will configure Home Agent services alone. An input of "FA" will configure Foreign Agent services alone. Inputs "HAFA", "HA-FA", "FAHA" or "FA-HA" will configure both services. Note that when configuration is in AAA-mode, only one service should be offered on all interfaces configured. See mipd(1M) for more information. Primary address of interface. Constitutes address of HA and source of advertisements. The user needs to input this information if the interface is not (UP, not POINTOPOINT or LOOPBACK). Otherwise, will configure the address for the interface. Netmask of primary address of interface. The user needs to input this information if the interface is not (UP, not POINTOPOINT or LOOPBACK). Otherwise, will configure the netmask for the interface IP address to which advertisements messages are broadcast. There are two valid inputs: 255.255.255.255 and 224.0.0.1. Default: will configure 255.255.255.255. Time interval between Agent advertisements. Value is in seconds and can include a decimal point value. This value should be no greater than 1/3 of the Router Lifetime value. If no value is configured, will use the value The size of the challenge window maintained by the FA service on this interface (if configured). The maximum value for this input is 8. If no value is configured, will use the value Time period after which Mobile Nodes should consider Agent (router) advertisements as expired. Value is in seconds. This value should be at least 3 times the advert_interval value. If no value is configured, will use the value 1800 (30 minutes). Maximum registration time that Mobile nodes can request. Registration requests for longer time periods will be rejected. Value is in seconds. If no value is configured, will use the value 300 (5 minutes). (Abbr.: Configure or update information about a Mobile Node or Correspondent Node. Use this command on a Home Agent to configure security parameters for authentication between the Home Agent and Mobile or Correspondent nodes. This command will automatically configure the replay protection scheme to Timestamps. ip_addr IP address of Mobile or Correspondent node for which information is configured. Index to identify the Security Association (SA) between the Mobile or Correspondent node and Home Agent. Must be a positive 32-bit integer greater than 255 and match the SPI configured on the Mobile or Correspondent node. The algorithm association with this Security Association (SA). The input configures the MD5 algorithm while the input configures the HMAC-md5 algorithm. By default configures the HMAC- md5 algorithm. Used by Home Agent to authenticate the Mobile Node's identity or the Correspondent node's identity. This 128-bit value should be specified as a sequence of 16 2-digit hex values sep- arated by spaces. Or, an input of "random" will generate a random key for the user. This key must match the key configured on the Mobile Node or the Correspondent node. (Abbr.: Configure one or more Care-of Addresses to advertise on an interface. interface_name Name of the interface to which Care-of Address will be added. coa_addr Care-of Address (IP) to advertise. This address must be the primary address of an interface (UP, not POINTOPOINT, and not LOOPBACK). At least one Care-of Address must be specified if FA services are offered on this interface. For all interfaces configured for FA services but without a Care-of Address, will configure the interface primary address as a Care-of Address when the user creates a configuration file. Users can configure up to eight Care-of Addresses. (Abbr.: Configure or update router addresses to be advertised on an interface. The arguments (except interface_name) may be repeated to configure or update multiple routers. interface_name Name of the interface to which router needs to be added. IP address of router to include in advertisements sent by FA. This address must be the primary address of an interface (UP, not POINTOPOINT, and not LOOPBACK). Users can configure up to eight router addresses. If no router addresses are sent in the advertisements, the Mobile node may use an advertised COA or the FA's address from the source field of the IP packet. Preference of router. Higher numbers imply higher preference. If preferences conflict between routers, the more recently added router will be given a higher preference value. Range: minus number_of_routers_configured. Netmask of router. If router address matches the address of an interface (UP, not POINTOPOINT, and not LOOPBACK), this information is automatically configured to the netmask for that interface. (Abbr.: (AAA-mode only.) Configure an address pool for home address allocation interface_name Name of the interface for which the pool is configured. start_addr Starting address of the pool. num_addr The number of consecutive addresses in the pool starting from If not specified, the pool will contain just one address -- start_addr. (Abbr.: Delete all session records. (Abbr.: (AAA-mode only.) Delete a home address pool from an interace. interface_name Name of the interface from which the address pool needs to be removed. addr One of the addresses in the address pool to delete. Omit this input to delete all address pools from the inter- face. (Abbr.: Delete one or more Care-of Addresses from an interface. interface_name Name of the interface from which Care-of Address needs to be removed. coa_addr Care-of Address (IP) to delete. Omit this input to delete all Care-of Addresses from the interface. (Abbr.: Delete global parameters. (Abbr.: Delete one or more interfaces from session records. interface_name Name of the interface to delete. Omit this input to delete all interfaces. (Abbr.: This command can be used to delete information about one or more Mobile or Correspondent nodes. ip_addr IP address of Mobile Node or Correspondent Node to be deleted. Omit this input to delete all Mobile/Correspondent nodes or non-AAA Mobile nodes. (Abbr.: Delete one or more router addresses for an interface. interface_name Name of the interface from which router needs to be removed. router_addr IP address of router to delete. Omit this input to delete all routers from the interface. List Commands These commands list information for various configuration data. (Abbr.: Display all session data. (Abbr.: List all global parameters. (Abbr.: Display information for one or more interfaces. interface_name Name of the interface to display. Omit this input to display all interfaces. (Abbr.: This command displays information for one or more Mobile or Correspondent nodes. ip_addr IP Address of Mobile Node or Correspondent Node to list. Omit this input to list all Mobile Nodes and Correspon- dent Nodes. Session Commands The remaining commands can be classified as session commands. (Abbr.: Perform bulk configuration using commands from a file. Users should ensure that the commands in the file are valid. conf_file Name of the file that contains configuration commands, one per line. (Abbr.: Create a configuration file for from session data. Users will be warned if configuration data is incomplete or not matching system parameters. For convenience, the tool does the following checks and modifications before writing data to the file.(1) The preferences of all routers will be normalized for all interfaces so that they range from 1 through n, where n is the number of routers configured for that interface. Any matching preference would result in the most recently added router getting the higher preference.(2) For all interfaces offering Foreign Agent services but without any configured care-of addresses, the primary address of the interface is automatically configured as a Care-of Address. filename Name of the file to create. (Abbr.: Exit from This forces to exit even if there are unwritten changes to the file. (Abbr.: Obtain syntax and brief description of commands. Use this switch as the first argument to get help on any arguments of command. This switch applies to every command specified by the user. command Command for which help is needed. User may repeat this argument as needed. Omit this argument to get list of all com- mands supported. (Abbr.: Clear the session display screen (similar to the command). (Abbr.: Display overview of process to configure (Abbr.: Display name, address, and netmask of all interfaces on the system (UP, not POINTOPOINT or LOOPBACK). This command may be used to correctly configure interfaces, routers, and care-of addresses. EXAMPLES Display configuration file Start mipconfig session by reading in contents of configuration file Configure interface lan1 and set services to HA and FA, max registration time to 600 secs, and add the Care-of address 128.227.205.77: Configure a Mobile node 123.5.6.4 with 734 as SPI, md5 as algorithm, and a randomly generated key: Configure router 128.227.205.99 to lan0 and set preference to 1 and netmask to 0xffff0000: Obtain help on commands and Write session records to file Example Sessions 1. Configure a Home Agent in a network with one Mobile Node (15.15.15.3) and one Correspondent Node (15.15.15.9). (The network topology has been simplified for this example.) # mipconfig Creating /var/adm/mip/mipd.conf mipconfig> conf interf lan0 -s ha mipconfig> conf node 15.15.15.3 -spi 1024 -key rand Random key: 90 68 72 d2 6b 7d 8f 8d 02 b7 6f b5 41 0a 3b 52 NOTE: replay protection for Mobile/Correspondent node 15.15.15.3 has been set to timestamps mipconfig> conf node 15.15.15.9 -spi 1025 -algo hmac-md5 -key 11 22 33 44 55 66 77 88 99 00 11 22 33 44 55 66 NOTE: replay protection for Mobile/Correspondent node 15.15.15.9 has been set to timestamps mipconfig> write Configuration file name (/var/adm/mip/mipd.conf): <CR> mipconfig> quit # 2. Configure a Foreign Agent. # mipconfig Creating /var/adm/mip/mipd.conf mipconfig> conf interf lan0 -s fa mipconfig> write NOTE: primary address 10.10.10.1 has been automatically configured as care-of address interface lan0 Configuration file name (/var/adm/mip/mipd.conf): <CR> mipconfig> quit # 3. Configure a AAA HA that supports one non-AAA Mobile Node and can allocate home addresses (The network topology has been simplified for this example.) # mipconfig /var/adm/mip/aaaHA.conf mipconfig> c g -af aaaserver.home.com -mf homeagent.home.com NOTE: AAA-mode configured. mipd cannot be configured to provide both HA and FA services mipconfig> conf node 15.15.15.3 -spi 1024 -key rand Random key: 90 68 72 d2 6b 7d 8f 8d 02 b7 6f b5 41 0a 3b 52 NOTE: replay protection for Mobile/Correspondent node 15.15.15.3 has been set to timestamps mipconfig> c i lan1 -s ha mipconfig> c p lan1 15.15.15.100 100 mipconfig> write /var/adm/mip/aaaHA.conf mipconfig> quit # AUTHOR was developed by Hewlett-Packard Company. SEE ALSO mipd(1M), mipd.conf(4). mipconfig(1M)
All times are GMT -4. The time now is 10:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy