Sponsored Content
Top Forums Shell Programming and Scripting awk file comparison, x lines after matching as output Post 302591989 by killerbee on Sunday 22nd of January 2012 06:57:18 AM
Old 01-22-2012
GOD BLESS YOU!! Thaks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Output format - comparison with I/p file

Hi, I have a file which contains more than 1 lakh records like following: a. name, id, city, state, country, phone (Expected I/P file format) name, id, city,, state, country, phone (Current I/P file format ) I want to achieve following tasks, a, Remove the extra comma in the... (1 Reply)
Discussion started by: velappangs
1 Replies

2. Shell Programming and Scripting

awk should output if one input file doesnt have matching key

nawk -F, 'FNR==NR{a= $3 ;next} $2 in a{print $1, 'Person',$2, a}' OFS=, filea fileb Input filea Input fileb output i am getting : (2 Replies)
Discussion started by: pinnacle
2 Replies

3. Shell Programming and Scripting

Merge lines in a file with Awk - incorrect output

Hi, I would like: FastEthernet0/0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 output errors, 0 collisions, 0 interface resets Serial1/0:0 is up, line protocol is up 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0... (14 Replies)
Discussion started by: mv652
14 Replies

4. Shell Programming and Scripting

Print lines matching value(s) in other file using awk

Hi, I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 Replies

5. Shell Programming and Scripting

Finding lines matching the Pattern and their previous lines in a file

Hi, I am trying to locate the occurences of certain pattern like 'Possible network disconnect' in a text file. I can get the actual lines matching the pttern using: grep -w 'Possible network disconnect' file_name. But I am more interested in getting the timing of these events which are... (7 Replies)
Discussion started by: sagarparadkar
7 Replies

6. UNIX for Dummies Questions & Answers

df -> output files; comparison using awk or...

:wall: I am trying to do the following using awk (is that the best way?): Read 2 files created from the output of df (say, on different days) and compare the entries using the 1st (FileSys) and 6th (Mount) fields to see if the size has changed. Output (at least), to a new file (some header... (2 Replies)
Discussion started by: renata
2 Replies

7. Shell Programming and Scripting

Help With AWK Matching and Re-printing Lines

Hi All, I'm looking to use AWK to pattern match lines in XML file - Example patten for below sample would be /^<apple>/ The sample I wrote out is very basic compared to what I am actually working with but it will get me started I would like to keep the matched line(s) unchanged but have them... (4 Replies)
Discussion started by: rhoderidge
4 Replies

8. Shell Programming and Scripting

awk to combine matching lines in file

I am trying to combine all matching lines in the tab-delimited using awk. The below runs but no output results. Thank you :). input chrX 110925349 110925532 ALG13 chrX 110925349 110925532 ALG13 chrX 110925349 110925532 ALG13 chrX 47433390 47433999 SYN1... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

awk to add lines with symbol to output file

In the awk below which does execute I get output that is close, except for all the lines that start with a # are removed. Some lines have one others two or three and after the script adds the ID= to the fields below the pattern in the awk, I can not seem to add the # lines back to the output. ... (5 Replies)
Discussion started by: cmccabe
5 Replies

10. UNIX for Beginners Questions & Answers

awk to average matching lines in file

The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :). f1 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
BLESS(8)						    BSD System Manager's Manual 						  BLESS(8)

NAME
bless -- set volume bootability and startup disk options SYNOPSIS
bless -help bless -folder directory [-folder9 directory] [-mount directory] [-bootinfo file] [-bootBlocks | -bootBlockFile file] [-save9] [-saveX] [-use9] [-system file] [-systemfile file] [-label name | -labelfile file] [-openfolder directory] [-setBoot] [-quiet | -verbose] bless -device device [-format [fstype] [-fsargs args] [-label name | -labelfile file]] [-bootBlockFile file] [-mount directory] [-wrapper file] [-startupfile file] [-system file] [-setBoot] [-quiet | -verbose] bless -info [directory] [-getBoot] [-bootBlocks] [-plist] [-quiet | -verbose] [-version] DESCRIPTION
bless is used to set volume bootability characteristics for PowerPC-based Macintoshes. It can also modify Open Firmware to select a different device to boot off of. bless has 3 modes of execution: Folder Mode, Device Mode, and Info Mode. Folder Mode allows you to select a folder on a mounted volume to act as the ``blessed'' system folder, and optionally update Open Firmware to boot from that volume. Device Mode is normally only used to format and setup a volume for the first time. Info Mode will print out the currently-blessed folder(s) of a volume, or if no mountpoint is specified, the volume that OF is set to boot from. Additionally, -help can be used to display the command-line usage summary. FOLDER MODE Folder Mode has the following options: -folder directory A blessed Mac OS X/Darwin system folder, containing a BootX secondary loader for New World machines. -folder9 directory A Mac OS 9/Classic system folder. If both -folder and -folder9 are given, preference can be given to boot into Mac OS 9 by also using the -use9 flag. -mount directory In lieu of specifying folders to bless, -mount can be given, and the pre-existing blessed folders are used. -bootinfo file Create a BootX file in the Mac OS X/Darwin system folder using file as a source. -bootBlocks Set the boot blocks on the volume. This is required for booting Mac OS 9. Boot blocks can be retrieved from the System file in the blessed Mac OS 9 system folder, or can be specified more directly using the -bootBlockFile or -system flags. -bootBlockFile file Extract boot blocks from file . The first 1024 bytes are read from the data fork of that file. -save9 Used if no -folder9 flag was given, but if the pre-existing Mac OS 9 system folder should be preserved. -saveX Used if no -folder flag was given, but if the pre-existing Mac OS X/Darwin system folder should be preserved. -use9 Used if both -folder and -folder9 were given, but Mac OS 9 should be the default for the volume. -system file Extract boot blocks from the file System file, using the Carbon resource manager. This will fail under Darwin, where Carbon is not present. -systemfile file Data fork System file to place in blessed System Folder -label name Render a text label used in the OpenFirmware-based OS picker -labelfile file Use a pre-rendered label used for the OpenFirmware-based OS picker -openfolder directory Specify a folder to be opened in the Finder when the volume is attached -setBoot Set the system to boot off the specified partition. This is implemented in a platform-specific manner. On Darwin PPC, the Open Firmware boot-device variable is modified. On Darwin x86, the MBR partition map is adjusted to mark the spec- ified partition as active -setOF Set the boot-device Open Firmware variable to boot off the volume containing. This option is deprecated in favor of the more generic -setBoot option. -quiet Do not print any output -verbose Print verbose output DEVICE MODE Device Mode has the following options: -device device Open the block device device . No volumes should be mounted from device . -format [fstype] Format the device using the fstype filesystem, or if it is not given, default to HFS+ with an HFS wrapper. -fsargs arg Additional arguments to newfs for the given filesystem -label name Give the filesystem the label while formatting, or set an OF-cased OS picker label -labelfile file Use a pre-rendered label used for the OpenFirmware-based OS picker name (in UTF-8 encoding) -bootBlockFile file Extract boot blocks from file . The first 1024 bytes are read from the data fork of that file. -mount directory Use directory as a temporary mount point for the HFS wrapper. -wrapper file Mount the wrapper on -mount and write file into the wrapper as the default System file. -system file Override the file specifications for -bootBlockFile and -wrapper and use this file instead for both those functions. -xcoff file Add the file as the HFS+ StartupFile, and update the partition map to reflect it's location on disk. This is necessary for Old World booting. This option is deprecated in favor of the more generic -startupfile option -setBoot Set the system to boot off the specified partition. This is implemented in a platform-specific manner. On Darwin PPC, the Open Firmware boot-device variable is modified. On Darwin x86, the MBR partition map is adjusted to mark the spec- ified partition as active -setOF Set the boot-device Open Firmware variable to boot off the volume containing. This option is deprecated in favor of the more generic -setBoot option. -startupfile file Add the file as the HFS+ StartupFile, and update other information on disk as appropriate for the startup file type. -quiet Do not print any output -verbose Print verbose output INFO MODE Info Mode has the following options: -info [directory] Print out the blessed system folder for directory . If directory is not specified, print information for the current boot-device (which may not necessarily be '/' . -setBoot Print out which device will be used on next boot, according to the boot-device Open Firmware variable. This option will take into account that OF might be pointing to an auxiliary booter partition, and will print out the correspond- ing root partition for those cases. -bootBlocks Print out salient fields from the boot blocks of the volume. -plist Output all information in Property List (.plist) format, suitable for parsing by CoreFoundation. This is most useful when bless is executed from another program and its standard output must be parsed. -quiet Do not print any output -verbose Print verbose output -version Print bless version and exit immediately FILES
/usr/standalone/ppc/bootx.bootinfo Secondary loader with XML headers, used with -bootinfo flag. Used for booting New World PPC-based Macin- toshes /System/Library/CoreServices Typical blessed folder for Mac OS X and Darwin EXAMPLES
FOLDER MODE To bless a volume with only Mac OS 9: bless -folder9 "/Volumes/Mac OS 9/System Folder" -bootBlockFile "/usr/share/misc/bootblockdata" To bless a volume with only Mac OS X or Darwin, and create the BootX file: bless -folder "/Volumes/Mac OS X/System/Library/CoreServices" -bootinfo "/Volumes/Mac OS X/usr/standalone/ppc/bootx.bootinfo" To set a volume containing either Mac OS 9 and Mac OS X to be the active volume: bless -mount "/Volumes/Mac OS" -setBoot INFO MODE To gather information about the currently selected volume (as determined by Open Firmware), suitable for piping to a program capable of pars- ing Property Lists: bless -info -plist -bootBlocks SEE ALSO
mount(8), newfs(8), nvram(8) Mac OS X August 3, 2003 Mac OS X
All times are GMT -4. The time now is 03:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy