Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 15 Hours Ago
147
Posted By RudiC
"asap" is a term highly deprecated in these...
"asap" is a term highly deprecated in these fora...



With either script, I get

rl 3 xpicrecovery 5 5
rl 4 xpicrecovery 5 5
rl 5 xpicrecovery 5 5


We need more to start analysing. Is it...
167
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"...
154
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...
154
Posted By RudiC
[^[:blank:]#;] # ONE char non-blank,...
[^[:blank:]#;] # ONE char non-blank, non-#, non-;
466
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...
348
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...
348
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...
241
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...
466
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[@]}; ...
324
Posted By RudiC
Well - compare configurations and report back,...
Well - compare configurations and report back, that is...
286
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
267
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
324
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.
348
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.
597
Posted By RudiC
The overall approach seems a bit complex,...
The overall approach seems a bit complex, selecting rows with identical criteria from a few different tables. How about serving a single db2 invocation a script, selecting all the criteria with an...
597
Posted By RudiC
How about trying, given your shell offers -...
How about trying, given your shell offers

- the mapfile command
- "here documents",


and db2 reads from stdin,



mapfile -td" " F1 < file1 ...
334
Posted By RudiC
None of your archive dates in the fifth column is...
None of your archive dates in the fifth column is older than 90 days


Mi 4. Dez 21:20:16 CET 2019
Mo 28. Okt 18:24:07 CET 2019
440
Posted By RudiC
You are right, that "feature" should not be taken...
You are right, that "feature" should not be taken for granted, but both my linux and FreeBSD versions have it. Still your caveat can / should be kept in mind.
379
Posted By RudiC
How far would this (untested) get you? awk...
How far would this (untested) get you?

awk -F',' '$5 == "V" {print "cp " FILENAME " /test/V_files/"}' tmo* | sh
Forum: Shell Programming and Scripting 2 Weeks Ago
499
Posted By RudiC
You could use this bashism (?; don't know about...
You could use this bashism (?; don't know about other shells) in the first place. man bash:str1=$'10.9.11.128\n-rwxr-xr-x user1 2019-12-29 17:53 /var/branch/custom/tg.xml...
Forum: Shell Programming and Scripting 2 Weeks Ago
466
Posted By RudiC
No sed required: TMP1="${A_LIGNE%$A_PATTERN*}" ...
No sed required:
TMP1="${A_LIGNE%$A_PATTERN*}"
TMP2="${A_LIGNE#*$A_PATTERN}"
echo "${TMP1%${TMP1##*[^ ]}} ${TMP2#${TMP2%%[^ ]*}}"
cnezJ,V ,FMZ fd,Mok CODKJ,F fcnQ, VMQKV Q
Should work for...
398
Posted By RudiC
see also...
see also (https://unix.stackexchange.com/questions/559719/bold-a-text-in-bash)
716
Posted By RudiC
To replicate above output, try awk '/FORMAT/...
To replicate above output, try
awk '/FORMAT/ {system("lsof -p$$; mv -vn "FILENAME " /tmp/" $10 "; lsof -p$$")}' fi*
.
.
.
sh 4523 user 3r REG 8,41 477 260226 /mnt/9/file1...
741
Posted By RudiC
Be aware that FPAT is available in gawk only....
Be aware that FPAT is available in gawk only. Also, the RS='' will split the file on empty lines, so use this only if the file is adequately structured.
741
Posted By RudiC
Why not awk 'END {print gsub(/of/, "&")}'...
Why not
awk 'END {print gsub(/of/, "&")}' RS='\0' file
EDIT: fell into the same trap as did nezabudka below: RS=\0 splits on empty lines. Use other non-text chars instead, e.g. \001 or \377...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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