Search Results

Search: Posts Made By: RudiC
122
Posted By RudiC
Looks like the well known / infamous DOS line...
Looks like the well known / infamous DOS line terminator problem:


$ RPT=test
$ sed 'p' $RPT
sed: can't read test: No such file or directory
$ RPT=test$'\r'
$ sed 'p' $RPT
: No such file or...
82
Posted By RudiC
For exactly the one line FASTA example above, try...
For exactly the one line FASTA example above, try
sed '/^>/ !{s/^/CTGA/; s/$/TAGTA/}' file
314
Posted By RudiC
@MadeInGermany: Wouldn't that print $0 twice,...
@MadeInGermany: Wouldn't that print $0 twice, once for each of the conditions?
153
Posted By RudiC
In awk, /.../ is (sort of) a regex constant. man...
In awk, /.../ is (sort of) a regex constant. man awk:
So, your expression /$4 ~ "101"/ will try to match exactly this string : $4 ~ "101" - which it won't find in your sample file.
Try
awk -F,...
169
Posted By RudiC
That how we "isolate" the relevant numerical (!)...
That how we "isolate" the relevant numerical (!) sort field from the rest of fields that are considered strings. We're lucky here in that sort seems to disregard the .ts extension when extracting /...
169
Posted By RudiC
Not sure I correctly understand your request. Are...
Not sure I correctly understand your request. Are we talking of sorting a file, or a directory listing? Did you check for the links at the bottom of this page? Given "media_w1956306127_b2500000" is...
134
Posted By RudiC
OK; give it a shot and report back the errors...
OK; give it a shot and report back the errors and/or shortfalls you encounter.
287
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...
270
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"...
289
Posted By RudiC
[^[:blank:]#;] # ONE char non-blank,...
[^[:blank:]#;] # ONE char non-blank, non-#, non-;
289
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...
594
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...
468
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...
337
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...
594
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[@]}; ...
384
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
353
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
Forum: Shell Programming and Scripting 2 Weeks Ago
435
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.
Forum: Shell Programming and Scripting 2 Weeks Ago
468
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.
Forum: Shell Programming and Scripting 2 Weeks Ago
435
Posted By RudiC
Well - compare configurations and report back,...
Well - compare configurations and report back, that is...
Forum: Shell Programming and Scripting 2 Weeks Ago
468
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...
698
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...
698
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 ...
Forum: Shell Programming and Scripting 2 Weeks Ago
440
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
538
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.
Showing results 1 to 25 of 500

 

Featured Tech Videos

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