Search Results

Search: Posts Made By: bayupw
2,226
Posted By Don Cragun
If I understand your post correctly, you might...
If I understand your post correctly, you might want to try:
awk '/^hostname /;/---BEGIN---/,/---END---/' file*
2,226
Posted By Scott
Your post seemed perfectly clear to me, even...
Your post seemed perfectly clear to me, even thought I misread it! It seems you want just the hostname, not the filename.


awk '/---BEGIN---/,/---END---/ {
if ( !F[H]++ ) print "hostname " H
...
2,226
Posted By Scott
One way: awk '/---BEGIN---/,/---END---/ { ...
One way:

awk '/---BEGIN---/,/---END---/ {
if ( !F[FILENAME]++ ) print H " " FILENAME
print $0
}' H=${HOSTNAME:-$(hostname)} *
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 06:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy