Search Results

Search: Posts Made By: RudiC
147
Posted By RudiC
How about (not THORUOGHLY tested!): $ L1=( a...
How about (not THORUOGHLY tested!):

$ L1=( a b c d i f gg )
$ L2=( 1 2 13 )
$ for i in ${!L1[@]}; do echo ${L1[i]}${L2[i%${#L2[@]}]}; done
a1
b2
c13
d1
i2
f13
gg1
Pipe through paste -sd"...
130
Posted By RudiC
[^[:blank:]#;] # ONE char non-blank,...
[^[:blank:]#;] # ONE char non-blank, non-#, non-;
130
Posted By RudiC
Don't worry, your overcomplicated regex doesn't...
Don't worry, your overcomplicated regex doesn't match anything reasonable in your file, if that is what you're after (not clear from your spec). Even uncommented lines with # removed (which I added...
442
Posted By RudiC
OK, (sigh), dealing with duplicates in iplist,...
OK, (sigh), dealing with duplicates in iplist, empty lines in data, and IPs not in iplist. Be aware that this is NOT a turnkey solution handling any special case that you / your data sources may come...
442
Posted By RudiC
I give up. Your new iplist is full of duplicates,...
I give up. Your new iplist is full of duplicates, your data have IPs not covered in iplist, and your data have at least one empty line responsible for the "bad array subscript" error (on stderr, by...
328
Posted By RudiC
Difficult to believe with unmodified input files....
Difficult to believe with unmodified input files. Pls report back your findings.


A regex using "alternation" as brought into play in rbatte1's post #4 will be the most efficient approach, as...
442
Posted By RudiC
So you skipped the | cut -f2-?
So you skipped the | cut -f2-?
213
Posted By RudiC
Try also awk -F\| ' {LN[NR] = $0 ...
Try also
awk -F\| '
{LN[NR] = $0
L = length($3)
if (L>MX[$2]) {MX[$2] = L
D3[$2] = $3
}
}
END {for...
442
Posted By RudiC
This is what I get on stdout after eliminating...
This is what I get on stdout after eliminating duplicates in your iplist, and empty lines in your data:
10.9.9.25
-rwxr-xr-x user1 2019-12-28 16:32 /tmp/TomChrgBatch.txt 3953673532
-rwxr-xr-x...
442
Posted By RudiC
Of course not. You are not...
Of course not.




You are not debugging MY code, but your code.


If you modify a working, tested code snippet, you better know EXACTLY what you are doing.
442
Posted By RudiC
Difficult to believe. How long would a string...
Difficult to believe. How long would a string need to be to buffalo awk?


What would that be, "non seek"?


How about
declare -A IPASS
IFS=,
for i in $iplist; do IPASS[$i]=${#IPASS[@]}; ...
442
Posted By RudiC
awk OK? Try awk -v"IPL=$iplist" ' BEGIN ...
awk OK? Try
awk -v"IPL=$iplist" '
BEGIN {for (MX=n=split(IPL, T, ","); n; n--) IPS[T[n]] = n
}
$1 in IPS {SORTC = IPS[$1]
DONE[$1] = 1
...
263
Posted By RudiC
A decent specification will help everybody to...
A decent specification will help everybody to save time and effort. Try


sed '/&@@10.10.10.10/ s/^/#/' file
263
Posted By RudiC
No, it is not. That is not what I...
No, it is not.


That is not what I proposed. Please specify EXACTLY what you need.
263
Posted By RudiC
Try sed 's/^/#/' file
Try
sed 's/^/#/' file
263
Posted By RudiC
Any attempts / ideas / thoughts from your side?
Any attempts / ideas / thoughts from your side?
238
Posted By RudiC
Or printf "%s%0*d\n" ${X} $((9-${#X})) 0 ...
Or
printf "%s%0*d\n" ${X} $((9-${#X})) 0
245700000
printf "%s%0$((9-${#X}))d\n" ${X}
245700000
308
Posted By RudiC
The ssh daemon is relevant on the target server....
The ssh daemon is relevant on the target server. Compare e.g. ssh.conf.
347
Posted By RudiC
On top of vgersh99's comments to your syntax, you...
On top of vgersh99's comments to your syntax, you also might want to consider a slightly different approach to the logics, which translates to


- if FILE2 and FILE3 exist, and
...- the weekday...
328
Posted By RudiC
Nice approach indeed! Could be curtailed to ...
Nice approach indeed!
Could be curtailed to
sed -r "/'($(paste -sd\| file2))'/s/^C//" file1, including the item list file as well.
308
Posted By RudiC
Well - compare configurations and report back,...
Well - compare configurations and report back, that is...
328
Posted By RudiC
Try awk -v"SQ='" ' FNR == NR ...
Try


awk -v"SQ='" '
FNR == NR {PAT[NR]="^C.*" SQ $0 SQ
MX = NR
next
}
{for (i=1; i<=MX; i++) if ($0 ~ PAT[i]) {sub...
308
Posted By RudiC
Sure the setup / configuration is identical on...
Sure the setup / configuration is identical on the two linux machines? The authentication processes don't indicate they are:


$ diff -by file[12] | grep "[<>|]"
...
269
Posted By RudiC
Definitely not. paste handles 3000 lines (and...
Definitely not. paste handles 3000 lines (and more!) nicely. The presumed errors in the input files will make awk fail as well. Get those errors corrected, and retry.
269
Posted By RudiC
Can't reproduce your problem: paste file[12] ...
Can't reproduce your problem:
paste file[12]
2020-01-07 235400 ossuser
2020-01-07 235400 ossuser
2020-01-07 235401 ossuser
2020-01-07 235401 ossuser
2020-01-07 235401 ossuser...
Showing results 1 to 25 of 500

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