Search Results

Search: Posts Made By: RudiC
9,610
Posted By RudiC
Not sure if this is the most elegant solution: ...
Not sure if this is the most elegant solution:
awk '
/^====/ {PRF = $2 = "0"$2
}
{print PRF, $0
}
' file |
sort -uk1,1 -k3 |
awk '
{X = $1
CNT[X]++...
9,610
Posted By RudiC
awk ' /^====/ {PRF = $2 = "0"$2 #...
awk '
/^====/ {PRF = $2 = "0"$2 # save the server info for the prefix &
} # add a "0" to server info for sorting
{print PRF, $0...
9,610
Posted By RudiC
Try awk '/^====/ {PRF = $2 = "0"$2} {print...
Try
awk '/^====/ {PRF = $2 = "0"$2} {print PRF, $0}' file | sort -uk1,1 -k3 | awk '{sub ($1 FS, _); sub (/^0/, _, $2)}1'
========== server_1 ==========
sample2.gz: 2016-09-14 01:09:56,796...
9,610
Posted By RudiC
So - you have coloured output in the files? Can't...
So - you have coloured output in the files? Can't they be produced without colour information?

Do you need the server_n info in the sorted output? If not, try
sort -uk2 file4
sample2.gz:...
9,610
Posted By RudiC
Where and how did you assign the variables in the...
Where and how did you assign the variables in the first place?
9,610
Posted By RudiC
Remove the control codes when/before assigning...
Remove the control codes when/before assigning the variables.
9,610
Posted By RudiC
You have "ECMA-48 Set Graphics Rendition" control...
You have "ECMA-48 Set Graphics Rendition" control codes in your variable definition - that's how the 62 char is reached. I think, sed complains about opening but no closing square brackets.
9,610
Posted By RudiC
There's no 62 chars in that regex; try setting...
There's no 62 chars in that regex; try setting the -vx options on the remote node, e.g. just before cd in the ssh command...
9,610
Posted By RudiC
After (c.f. man zcat) there's no compressed data...
After (c.f. man zcat) there's no compressed data any more, so using zgrep is overkill (although it may work as zgrep recognizes and works on uncompressed data).

2nd point: you have ...
9,610
Posted By RudiC
There seem to be several problems with your above...
There seem to be several problems with your above code:
- shell variable assignment doesn't allow for spaces, so remove those around the "=" sign, and use quoting or escaping for the contents.
-...
Showing results 1 to 10 of 10

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