Sponsored Content
Top Forums Shell Programming and Scripting Cant see rest of the output of the file using awk Post 302737083 by Jared on Wednesday 28th of November 2012 11:03:59 AM
Old 11-28-2012
i tried your suggestion dos2unix and then ran the cmd awk with same result. i am still not able to see the desired output under hardware inventory.
any suggestion.

dos2unix wor3e01_result.txt
Code:
$ awk '{ if ( $0 ~ "^Hardware inventory" ) { print; getline tmp; print tmp } } ' wor3e01_result.txt

Hardware inventory:
Item             Version  Part number  Serial number     Description


as you can see i expect to see something after hardware inventory but no output....i think i tmay be somethign to do with $0 but not sure..

any help will be appreciatiated...

---------- Post updated at 11:03 AM ---------- Previous update was at 10:57 AM ----------

jotne,

i tried your suggestion it did work but add some extra line on top whihc i realy dont need.. any idea

Last edited by Scott; 11-28-2012 at 12:28 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want to execute rest of the script after the file is ready ...

Hi All I have a requirement like, where a file gets generated in a particular dir and once the file is ready and available then I want to execute rest of the script, because untill and unless the file exists and is available there is no use of running rest of the commands in that script. ... (5 Replies)
Discussion started by: csaha
5 Replies

2. Shell Programming and Scripting

Awk adding a space between integer and the rest of the field

Hi, I have a problem where some of the records I need to process have the first address field as something like "10Walpole Street" where obviously I want it to be "10 Walpole Street". I know I need to somehow separate out the integer and probably form a new string variable, but I just don't... (5 Replies)
Discussion started by: jonathanm
5 Replies

3. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

4. Shell Programming and Scripting

Cut last 13 characters and take the rest of the file name

Hi, I would like to cut last 13 characters of a file name and take the rename the file name as follows: Input: A.DAT20110517033732 Output: A.DAT I have tried the following command and cut last 13 characters. echo A.DAT20110517033732 | awk '{print substr($0, length($0)-13)}' ... (3 Replies)
Discussion started by: pyaranoid
3 Replies

5. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

6. UNIX for Dummies Questions & Answers

find string and get the rest of the line in a pipe delimited file

Hi friends, I have a file where I should search for a string and get the rest of the line but without the delimiter using awk. for example I have the series of string in a file: input_string.txt bbb ccc aaa and the mapping file looks like this. mapping.txt aaa|12 bbb|23 ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies

7. Shell Programming and Scripting

Find the text in the file and delete the rest of the line.

Hi, I have one requiremnet like this. I need to find some particular string (eg.IncludeDateTime = ) in a file. And wherever it finds the string the unix script has to delete the remaining text coming after the string (ie., 'IncludeDateTime = ' ) in the same line. I tried to write this script in... (5 Replies)
Discussion started by: jannusuresh
5 Replies

8. Shell Programming and Scripting

[Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected

Hi All, I Have written a script through that i am calling sql file Sqlfile.sql set time on set timing on set echo on set head off set scan on set feedback on set serveroutput on set linesize 1000 DECLARE v_acc_no NUMBER(10); v_product_no NUMBER(10); BEGIN... (3 Replies)
Discussion started by: sujit_kashyap
3 Replies

9. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

10. Shell Programming and Scripting

awk to reformat output if input file is empty, but not if file has data in it

The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format: input chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18 chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies
xfsinvutil(8)						      System Manager's Manual						     xfsinvutil(8)

NAME
xfsinvutil - xfsdump inventory database checking and pruning utility SYNOPSIS
xfsinvutil [-F|-i] [-m media_label] -M mount_point mm/dd/yyyy xfsinvutil [-F|-i] [-m media_label] -u UUID mm/dd/yyyy xfsinvutil [-F] -s SESSION_ID xfsinvutil -i xfsinvutil -C DESCRIPTION
xfsdump maintains an online dump inventory in /var/lib/xfsdump/inventory. The -I option of xfsdump displays the inventory contents hierar- chically. The levels of the hierarchy are: filesystem, dump session, stream, and media file. xfsinvutil is a utility to check this inventory database for consistency, to remove entries of dump sessions which may no longer be of rel- evance, and to browse the contents of the inventory. The following command line options are available: -F Don't prompt the operator. When xfsinvutil encounters a matching dump session, xfsinvutil will normally ask the operator for permis- sion to delete the entry. With this option the deletion is performed, no questions asked. -i Interactive mode. Causes xfsinvutil to run in a mode that will allow the operator to browse and modify the contents of the inventory. Please refer to the Interactive Mode section below for more information. -M mount_point mm/dd/yyyy Prunes dump sessions identified by the given mount point which were created prior to the specified date. Optionally -m may be be spec- ified to further limit the matching dump sessions by media label. xfsinvutil will prompt the operator prior to pruning a dump session unless the -F or -i options are given. -u UUID mm/dd/yyyy Like -M, except the matching filesystem is specified using its universally unique identifier (UUID) instead of its mount point. -m media_label If specified, only sessions with at least one media file whose label matches this value will be eligible for pruning. This restric- tion is in addition to those imposed by the date and the -M or -u options. This option allows the pruning of all inventory references to media which may have been overwritten or lost. Note that this option does not apply to sessions with no media files. -s SESSION_ID Prunes the dump session identified by the given session id. xfsinvutil will prompt the operator prior to pruning a dump session unless the -F option is given. -C With this option, xfsinvutil performs consistency checks for all entries in the inventory database. It fixes any problems found. If no consistent entries are found , the corresponding inventory database file is removed. Interactive Mode When run with -i, xfsinvutil will present the operator with a hierarchical representation of the xfsdump inventory. In this mode, the operator can use the arrow keys (or the h j k l keys) to navigate the inventory and also use the following keys and functionality: + Expand a branch of the tree. - Collapse a branch of the tree. * Fully expand a branch of the tree. % Fully collapse a branch of the tree. h Move selection to the parent entry. l Move selection to the child entry. j Move selection to next entry. k Move selection to previous entry. d Mark the current record, and all sub-records, to be deleted. u Clear the current record and all parent records from being deleted. i Import another xfsdump inventory. ? Show help window. x Commit any changes made to the inventory, and exit the program. q Exit the program without committing any changes to the inventory. Inventories from other hosts can be imported to create a larger common inventory. It is recommended that the contents of /var/lib/xfs- dump/inventory on the remote host be copied to a temporary local directory prior to running xfsinvutil. When xfsinvutil is run in interac- tive mode, and the operator hits i, they will be prompted for the path to the inventory to be imported. xfsinvutil will then add the con- tents of the imported inventory to the main window, and all entries will be marked as imported. The operator can then delete any of these entries that are not to be imported. When the operator commits the changes, xfsinvutil will import any entries which were not marked as deleted. Deleted entries are not actually deleted from the original imported inventory. NOTES
Inventory Each dump session updates an inventory database in /var/lib/xfsdump/inventory. xfsdump uses the inventory to determine the base of incre- mental and resumed dumps. This database can be displayed by invoking xfsdump with the -I option. The display uses tabbed indentation to present the inventory hier- archically. The first level is filesystem. The second level is session. The third level is media stream (currently only one stream is supported). The fourth level lists the media files sequentially composing the stream. FILES
/var/lib/xfsdump/inventory dump inventory database SEE ALSO
xfsdump(8), xfsrestore(8). xfsinvutil(8)
All times are GMT -4. The time now is 04:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy