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 [--file file] [--bootinfo [file]] [--bootefi [file]] [--label name | --labelfile file] [--setBoot] [--openfolder directory] [--nextonly] [--shortform] [--legacy] [--legacydrivehint device] [--options string] [--quiet | --verbose] bless --mount directory [--file file] [--setBoot] [--nextonly] [--shortform] [--legacy] [--legacydrivehint device] [--options string] [--quiet | --verbose] bless --device device [--label name | --labelfile file] [--startupfile file] [--setBoot] [--nextonly] [--shortform] [--legacy] [--legacydrivehint device] [--options string] [--quiet | --verbose] bless --netboot --server url [--nextonly] [--options string] [--quiet | --verbose] bless --info [directory] [--getBoot] [--plist] [--quiet | --verbose] [--version] bless --unbless directory DESCRIPTION
bless is used to modify the volume bootability characteristics of filesystems, as well as select the active boot volume. bless has 6 modes of execution: Folder Mode, Mount Mode, Device Mode, NetBoot Mode, Info Mode, and Unbless Mode. Folder Mode allows you to select a directory on a mounted volume to act as the ``blessed'' directory, which causes the system firmware to look in that directory for boot code. EFI-based systems also support a ``blessed'' system file, which is the primary mechanism of specifying the booter for a volume for those systems. In Folder Mode, if you are operating on an HFS+ volume, the HFS+ Volume Header is updated to reflect the files/directories given, which persists even if the volume is moved to another system or NVRAM is cleared. Mount Mode does not make permanent modifications to the filesystem, but rather set the system firmware to boot from the specified volume, assuming it has been properly blessed. This is a subset of the functionality of Folder Mode with the --setBoot option, but is convenient when you don't want to change or interrogate the filesystem for its blessed status. Device Mode is similar to Mount Mode, but allows selection of unmounted filesystems, for instance while in single user mode. It can also per- form certain offline modifications to the filesystem, but is not generally recommended. NetBoot Mode sets the system firmware to boot from the network, using a URL syntax to specify the protocol and server. bless only sets the local system to go into NetBoot mode, and does not communicate to the server what image should be used, if there are multiple images. Some other mechanism, such as using Startup Disk, should be used to select that. Info Mode will print out the currently-blessed directory of a volume, or if no mountpoint is specified, the active boot volume that the firmware is set to boot from. Unbless Mode complements Folder Mode, and clears the persistent blessed folder and file information on HFS+ volumes. Additionally, --help can be used to display the command-line usage summary. FILE/FOLDER MODE Folder Mode has the following options: --folder directory Set this directory to be the Mac OS X/Darwin blessed directory, containing a BootX secondary loader for New World machines. --file file Set this file to be the Mac OS X/Darwin blessed boot file, containing a booter for EFI-based systems. If this option is not provided, a default boot file is used based on the blessed directory. --bootinfo [file] Create a BootX file in the Mac OS X/Darwin system folder using file as a source. If file is not provided, a default is used (see FILES), using a path relative to the mountpoint you are blessing. This attempts to ensure that a BootX is used that is compatible with the OS on the target volume. --bootefi [file] Create a boot.efi file in the Mac OS X/Darwin system folder using file as a source. If file is not provided, a default is used (see FILES), using a path relative to the mountpoint you are blessing. This attempts to ensure that a boot.efi is used that is compatible with the OS on the target volume. If --file is also provided, the new file will be created at that path instead. --label name Render a text label used in the firmware-based OS picker --labelfile file Use a pre-rendered label used for the firmware-based OS picker --openfolder directory Specify a folder to be opened in the Finder when the volume is mounted by the system. --setBoot Set the system to boot off the specified partition. This is implemented in a platform-specific manner. On Open Firmware-based systems, the boot-device variable is modified. On EFI-based systems, the efi-boot-device variable is changed. --nextonly Only change the boot device selection for the next boot. This is only supported on EFI-based systems. --shortform Use an abbreviated device path form. This option can allow for booting from new devices, at the expense of boot time performance. This is only supported on EFI-based systems. --legacy If --setBoot is given, set the firmware to boot a legacy BIOS-based operating system from the specified disk. The active flag of an MBR-partitioned disk is not modified, which can be done with fdisk(8) . This is only supported on EFI-based systems. --legacydrivehint device Instruct the firmware to treat the specified whole disk as the primary, master IDE drive. This is only supported on EFI-based systems. --options Set load options associated with the new boot option. This is only supported on EFI-based systems, and in general should be avoided. Instead, use nvram(8) to set "boot-args" , which will work with both Open Firmware- and EFI-based systems. --quiet Do not print any output --verbose Print verbose output MOUNT MODE Mount Mode has the following options: --mount directory Use the volume mounted at directory to change the active boot volume, in conjunction with --setBoot . The volume must already be properly blessed. --file file Instead of allowing the firmware to discover the booter based on the blessed directory or file, pass an explicit path to the firmware to boot from. This can be used to run EFI applications or EFI booters for alternate OSes, but should not be normally used. This is only supported on EFI-based systems. --setBoot Same as for Folder Mode. --nextonly Same as for Folder Mode. --shortform Same as for Folder Mode. --legacy Same as for Folder Mode. --legacydrivehint device Same as for Folder Mode. --options Same as for Folder Mode. --quiet Do not print any output --verbose Print verbose output DEVICE MODE Device Mode has the following options: --device device Use the block device device to change the active boot volume. No volumes should be mounted from device , and the filesystem should already be properly blessed. --label name Set the firmware-based OS picker label for the unmounted filesystem, using name , which should be in UTF-8 encoding. --labelfile file Use a pre-rendered label used with the firmware-based OS picker. --setBoot Set the system to boot off the specified partition, as with Folder and Mount Modes. --startupfile file Add the file as the HFS+ StartupFile, and update other information on disk as appropriate for the startup file type. --nextonly Same as for Folder Mode. --shortform Same as for Folder Mode. --options Same as for Folder Mode. --legacy Same as for Folder Mode. --legacydrivehint device Same as for Folder Mode. --quiet Do not print any output --verbose Print verbose output NETBOOT MODE NetBoot Mode has the following options: --netboot Instead of setting the active boot selection to a disk-based volume, set the system to NetBoot. --server protocol://[interface@]server A URL specification of how to boot the system. Currently, the only protocol supported is BSDP ("bsdp"), Apple's Boot Service Discovery Protocol. The interface is optional, and the server is the IPv4 address of the server in dotted- quad notation. If there is not a specific server you'd like to use, pass "255.255.255.255" to have the firmware broadcast for the first available server. Examples of this notation would be "bsdp://255.255.255.255" and "bsdp://en1@17.203.12.203". --nextonly Same as for Folder Mode. --options Same as for Folder Mode. --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 the volume mounted at directory . If directory is not specified, print information for the currently selected boot volume (which may not necessarily be '/' . --getBoot Print out the logical boot volume, based on what is currently selected. This option will take into account the fact that the firmware may be pointing to an auxiliary booter partition, and will print out the corresponding root parti- tion for those cases. If the system is configured to NetBoot, a URL matching the format of the --server specifica- tion for NetBoot mode will be printed. --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 UNBLESS MODE Unbless Mode has the following options: --unbless directory Use the HFS+ volume mounted at directory and unset any persistent blessed files/directories in the HFS+ Volume Header. FILES
/usr/standalone/ppc/bootx.bootinfo Secondary loader with XML headers, used with the --bootinfo flag. Used for booting New World PPC-based Macintoshes. If the argument to --bootinfo is ommitted, this file will be used as the default input. /usr/standalone/i386/boot.efi Booter for EFI-based systems, used with the --bootefi flag. If the argument to --bootefi is ommitted, this file will be used as the default input. /System/Library/CoreServices Typical blessed folder for Mac OS X and Darwin EXAMPLES
FOLDER MODE To bless a volume with only Mac OS X or Darwin, and create the BootX and boot.efi files as needed: bless --folder "/Volumes/Mac OS X/System/Library/CoreServices" --bootinfo --bootefi MOUNT MODE To set a volume containing either Mac OS 9 and Mac OS X to be the active volume: bless --mount "/Volumes/Mac OS" --setBoot NETBOOT MODE To set the system to NetBoot and broadcast for an available server: bless --netboot --server bsdp://255.255.255.255 INFO MODE To gather information about the currently selected volume (as determined by the firmware), suitable for piping to a program capable of pars- ing Property Lists: bless --info --plist SEE ALSO
mount(8), newfs(8), nvram(8) Mac OS X May 24, 2013 Mac OS X
All times are GMT -4. The time now is 02:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy