Sponsored Content
Top Forums Shell Programming and Scripting AWK Help ME! this easy for who know Post 302375054 by He2 on Thursday 26th of November 2009 08:34:57 AM
Old 11-26-2009
Dear, momo.reina.

Thank you for your commitment and the response, however, I need to do a comparison to the $ 4 string file1 contains the beginning of the string $ 3 file2, then if true print $ 1, $ 2, $ 3 (file2) and $ 3 (file1).

The output should have the following format:
CRA-JJ-W980-01; 2009-11-24, 0/0/0; GigabitEthernet
CRA-JJ-W980-01; 2009-11-24, 1/0/0; GigabitEthernet
CRA-JJ-W980-01; 2009-11-24, 3/0/0; GigabitEthernet
CRA-JJ-W980-01; 2009-11-24, 5/0/1; GigabitEthernet
CRA-JJ-W980-01; 2009-11-24, 13/0/0; ATM
CRA-JJ-W980-01; 2009-11-24, 13/0/1; ATM
CRA-JJ-W980-01; 2009-11-24, 13/0/2; ATM
CRA-JJ-W980-01; 2009-11-24, 13/0/3; ATM
CRA-JJ-W980-01; 2009-11-24, 14/0/0; ATM
CRA-JJ-W980-01; 2009-11-24, 14/0/1; ATM
CRA-JJ-W980-01; 2009-11-24, 14/0/2; ATM
CRA-JJ-W980-01; 2009-11-24, 14/0/3; ATM
CRA-JJ-W980-01; 2009-11-24, 15/0/0; ATM
CRA-JJ-W980-01; 2009-11-24, 15/0/1; ATM
CRA-JJ-W980-01; 2009-11-24, 15/0/2; ATM
CRA-JJ-W980-01; 2009-11-24, 15/0/3; ATM

thanks

He2

---------- Post updated at 11:34 AM ---------- Previous update was at 11:28 AM ----------

Dear, durden_tyler

Thanks for the reply. Your script generated the output perfect, but in my shell (Solaris 7 with bash-2.05) can not work with vector.
Always gives error in the scripts array.
thanks

He2
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Easy question about awk gsub

How does one escape the left bracket in awk? For example: | awk 'gsub (" I'm sure it's pretty simple, I'm just a noob. (1 Reply)
Discussion started by: TheCrunge
1 Replies

2. Shell Programming and Scripting

Easy AWK question

Ive got some output in a file that looks exactly like this: 1 ----------- 1542 1 record(s) selected. How do I just extract that 1542 and drop it into another file or (preferrably) a variable (using a ksh script) (9 Replies)
Discussion started by: rdudejr
9 Replies

3. UNIX for Dummies Questions & Answers

Need help on installing an EASY to use and easy to install command line text editor

Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some. I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies

4. UNIX for Dummies Questions & Answers

Newbie Help with Grep or Awk .. Easy one ...

I have this output: uniquemember=uid=315kthatch,ou=people,ou=client315,dc=paisleyhosting,dc=com and i want the output to be just this: 315kthatch I need it to be generic tho, because I have hundreds of lines of output, and the preceding numbers are not always 315. So I would need... (3 Replies)
Discussion started by: kthatch
3 Replies

5. UNIX for Dummies Questions & Answers

fun and easy awk question

I have a file called mytitles.txt containing a list of book titles I have a second file called abfile.txt containing a list of book titles (in the 3rd field) and it has author info and copyright year info as well.. I want to search mytitles.txt for a match in the 3rd field of abfiles.txt, and... (2 Replies)
Discussion started by: glev2005
2 Replies

6. Shell Programming and Scripting

awk Help: quick and easy question may be: How to use &&

Hi Guru's. I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 : awk '{ if ($5>80) && if ($5 != 100) print $0} But getting error: >bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}' syntax error The source line is 1. The error... (6 Replies)
Discussion started by: rveri
6 Replies

7. Shell Programming and Scripting

Couple of easy questions for experts on awk/sed

Hello Experts.. I have 3-4 C codes with Oracle SQL statements embedded. All the SQL statements starts with EXEC SQL keyword and ends with ;. I want to extract all the SQL statements out of these codes. I did awk '/^EXEC SQL/,/\;/' inputFile (I use this on all of the codes individually). That... (2 Replies)
Discussion started by: juzz4fun
2 Replies

8. Shell Programming and Scripting

awk easy question

So, I have the following code: cat testfile.txt | awk -F, '{ print $1" "$2" "$3" "$4" "$5 }' | read DOC ORG NAME echo "$DOC" echo "$ORG" echo "$NAME" My testfile.txt looks something like the following: Document Type,Project Number,Org ID,Invoice Number It will eventually be more... (14 Replies)
Discussion started by: Parrakarry
14 Replies
ioinit(1M)																ioinit(1M)

NAME
ioinit - test and maintain consistency between the kernel I/O data structures and the ioconfig files SYNOPSIS
DESCRIPTION
Starting with HP-UX 11i Version 3, there are two ioconfig files, which is the same as on prior releases and which contains additional agile entries (see intro(7) for information on agile addressing). These two ioconfig files will have their copies in as and respectively. The command is invoked by the process when the system is booted, based on the entry in where is a script to invoke with the and options. Given the option, checks consistency between the versions of ioconfig files and the versions of ioconfig files. If these files are consistent, invokes to install special files for any new devices found. If versions of ioconfig files are inconsistent with versions, updates versions of ioconfig files from versions and, if the option is given, reboots the system. If or is corrupted or missing when the system reboots, brings the system up in single-user mode. The user should then restore or accord- ingly from backup or invoke with the option to recreate and from the kernel. If the option is given, reassigns instance numbers to existing devices within a given class based on infile. If the driver associated with the given hardware path does not support online instance number reassignment, reboot is required. If finds no errors associated with the reassignment, and the option is given, the system is rebooted. (See the section.) If the option is used with option, the command performs Critical Resource Analysis (CRA) on all the devices corresponding to the hardware paths specified in infile, before assigning the new instance numbers. Existing device special files of LUNs, whose instance number is to be reassigned, will be deleted and recreated after the reassignment of instance numbers. If the driver associated with the given hardware path does not support online instance number reassignment, the option must be used. If the option is given, recreates and from the existing kernel I/O data structures. If the option is given, verifies if there is any corruption in the specified system file. If the option is given, the kernel is forced to reassign instance numbers, starting from 0, for existing devices with the given class_name on the next reboot. Note that this option must be used with the option, which reboots the system immediately, if the operation is success- ful. Options recognizes the following options: Performs Critical Resource Analysis (CRA) on all the devices corresponding to the hardware paths specified in infile. Instance numbers will be reassigned as specified in infile, only if CRA of all these devices report SUCCESS. Existing device special files of LUNs whose instance number are reassigned will be deleted and recreated with the updated instance numbers. The option must be specified when using the option. (See the option below.) If the driver associated with at least one given hardware paths does not support online instance number reassignment, the option must also be specified. (See the option below.) If the infile contains a hardware path of a node whose driver does not support online instance number reassignment and option is not specified, the command aborts the operation. Recreates and files from the kernel if any of these files are missing or cannot be restored from backup. Whenever updates these files from information obtained from the kernel, it saves the current ioconfig file (the last known good one) before updating them as and in order to keep them synchronized with kernel I/O data structures. If ioconfig files are missing or corrupt, users are advised to copy the file from the last known good file so that the least amount of information is lost. If is invoked, any previous binding of hardware path to device class and instance number may be lost. Forces the kernel to reassign instance numbers starting from 0 for all existing devices with the given class_name. This option must be used with the option. On successful completion the system is rebooted immediately. Use the file infile to reassign instance numbers to devices within a specified class. infile may have multiple entries, each to appear on a separate line, each field in the entry separated by one or more blanks. Entries should conform to the following for- mat: h/w_path class_name instance_# preprocesses the contents of infile, looking for invalid entries, and prints out explanatory messages. An entry is con- sidered to be invalid if the specified hardware path or class name does not already exist in the system. If the specified instance number already exists for the given class, the entry is invalid if it is not for circular reassignment. On suc- cessful completion of this operation, previous special files will still be associated with the device. Invoke to install special files for new devices after checking consistency between the versions of the ioconfig files and the versions. This creates device special files for any new devices found on the system. Reboot the system when it is required to correct the inconsistent state between the kernel, and as used with the option. When used with the option, if there are no errors associated with the instance reassignment, reboots the system. Verify if there is any corruption in ioconfig_file. If the verification of ioconfig_file is successful, the command displays a message showing if the type of ioconfig_file is either legacy (for example, or agile (for example, Note: HP-UX should not be rebooted without the file. If the file is missing or corrupted, HP-UX will recreate the file before rebooting the system. If the system needs to be booted without the file (thus losing all the persistent I/O infor- mation (see ioconfig(4)), the user can delete the file and reboot the system with the command (see reboot(1M)). RETURN VALUE
No errors occurred, although warnings might be issued. encountered an error. was recognized as an file but it was found corrupted during verification. DIAGNOSTICS
Most of the diagnostic messages from are self-explanatory. Listed below are some messages deserving further clarification. Errors cause to halt immediately. Errors Either restore or accordingly from backup and then reboot, or recreate or using Change permissions to to allow access by completed successfully, but failed. Instance number already exists for a given class. Use to remove the existing instance number, then retry. The given hardware path is not in the kernel. Use to get the correct hardware path, then retry. The given class name is not in the kernel. Use to get the correct class name, then retry. EXAMPLES
To reassign an instance number to a device and class (specified in infile) and reboot the system: where infile contains the following: is the h/w_path, is the class_name, and is the instance_#. is the h/w_path, is the class_name, and is the instance_#. To achieve circular reassignment of instance numbers between two existing devices of a class (specified in infile), assuming the driver associated with the given hardware paths support online reassignment of instance numbers. where infile contains the following: is the h/w_path, is the class_name, and is the instance_#. The existing instance_# of this device is 30. is the h/w_path, is the class_name, and is the instance_#. The existing instance_# of this device is 20. After the successful completion of this operation, will have the new instance_# as 20 and will have the new instance_# as 30. Verify file for corruptions and find if it is of type legacy or agile. WARNINGS
Running or overwrites the effect of instance number reassignment by before the system is rebooted. The previous statement applies only for devices whose drivers do not support online instance number reassignment. AUTHOR
was developed by HP. FILES
SEE ALSO init(1M), insf(1M), ioscan(1M), rmsf(1M), inittab(4), ioconfig(4), intro(7). ioinit(1M)
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy