Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.

Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 8 Hours Ago
201
Posted By RudiC
Did you try the proposal given (based on your...
Did you try the proposal given (based on your non-representative sample in post #1) with your revised data, perhaps with revised search patterns?


1. The #! /bin/bash shebang is pointless on line...
63
Posted By RudiC
This split --version split (GNU coreutils) 8.30...
This split --version
split (GNU coreutils) 8.30 seems to have the filter receive the split input lines on its stdin.
Try
split -l25 --filter="command-to-create-workspaces params" ws-userlist.txt
193
Posted By RudiC
WHAT "is not working"? Any error messages? ...
WHAT "is not working"? Any error messages?


If it's about awk not being happy with the field separator try escaping the square brackets:
dlm="<SelectStatement modified='1'...
201
Posted By RudiC
Are those § and ɸ always in the same line? Is the...
Are those § and ɸ always in the same line? Is the first § at BOL, and ɸ at EOL? Try


sed -e'/^§/,/ɸ$/ {/ɸ/ rheader' -e'; d}' content
74
Posted By RudiC
Would this come close to what you envision? ...
Would this come close to what you envision?
SEC=10
printf -- '------------------------------------\n\e[s'
while (( --SEC )); do printf '\e[uwaiting %2d seconds\n' $SEC; sleep 1; done
printf...
268
Posted By RudiC
Might have been smart to mention your OS...
Might have been smart to mention your OS version...
268
Posted By RudiC
Try also awk 'NR == 1 {$NF = ""} 1' file This...
Try also
awk 'NR == 1 {$NF = ""} 1' file
This is a
This is a fat cat
This is a fat black cat

awk 'NR == 1 {sub (/cat$/, "")} 1' file
This is a
This is a fat cat
This is a fat black cat
212
Posted By RudiC
comm <(sort file1) <(sort file2) FEA1234 ...
comm <(sort file1) <(sort file2)
FEA1234
FEA1235
FEA3323
FEA3413
FEA3433
FEA3453
FEA34A3
FEA4343
301
Posted By RudiC
Could be simplified as you want to quit after the...
Could be simplified as you want to quit after the first ip encountered:
ip=$(sed -n '/inet */ {s///; p; q}' file)
210
Posted By RudiC
Try awk '{gsub ("vijay@gmail.com",...
Try

awk '{gsub ("vijay@gmail.com", "vijay.bhaskar@gmail.com")} 1' $(find /home -name "*.sh")
340
Posted By RudiC
for ctry in de nz usa uk aus aut nl do ...
for ctry in de nz usa uk aus aut nl
do VLD=${ctry/${ctry/@($rplst)}}
SD=${VLD:+diff}
final_var=${SD:-source}_table_${ctry}_final
echo $final_var
done...
169
Posted By RudiC
You're close. Try sed -r...
You're close. Try
sed -r 's/([0-9])\/([0-9])/\1\t\2/' file
view pz19a0c0 1000T_J_3MoDw9DSLh1ZsCubdua-LKOQmbtiVgkIsiMbSiwF467?sessionId=15451401994597121249
view pz19a0c0 ...
340
Posted By RudiC
Not sure (as your requirement is still unclear)...
Not sure (as your requirement is still unclear) if this one, using recent bash's extglob option and some "parameter expansions", gets you somewhere:


shopt -s extglob
rplst="nz|usa|uk"
for...
340
Posted By RudiC
How is that "country parameter" supplied and...
How is that "country parameter" supplied and evaluated?
The @ctry part has which value, for _aus_ to be part of the final string?

Which table is relevant - diff_table or source_table - or is the...
340
Posted By RudiC
In bash, the unloved, deprecated eval helps: ...
In bash, the unloved, deprecated eval helps:


eval echo ${src/@ctry/{$rplst\}}
source_table_nz_final source_table_usa_final source_table_uk_finaland, no, the $ and { need to be in that sequence...
294
Posted By RudiC
That's what "back references" (man regex / man...
That's what "back references" (man regex / man sed) are for. But I think your "ansatz" is flawed - you could use the "pattern1" in awk only with tricks.
Paint the whole picture, include sample input...
294
Posted By RudiC
Not sure I understand the request. You have a...
Not sure I understand the request. You have a text file processed by awk and want it preprocessed by sed? Why don't you do all of it in awk itself?
296
Posted By RudiC
Keep it simple: df | awk -vCOLS="3 4" 'BEGIN...
Keep it simple:
df | awk -vCOLS="3 4" 'BEGIN {NC = split (COLS, C)} {for (i=1; i<=NC; i++) printf "%s\t", $C[i]; print _}'
Used Available
5926800 6123416
239864 9750808 ...
338
Posted By RudiC
Your script works flawlessly in bash, so I...
Your script works flawlessly in bash, so I presume you run it with ksh. man ksh:


BTW, what you are doing is a test for a non-zero string e.g. "/usr/bin/bash", not for the existence of a file or...
332
Posted By RudiC
Try also awk -F"[| ]" ' $2 ~ /^PF/ && ...
Try also
awk -F"[| ]" '
$2 ~ /^PF/ &&
PF[$1] !~ $2 {PF[$1] = PF[$1] DLP[$1] $2
DLP[$1] = ","
}
NF > 2 {for (i=3; i<=NF; i++) if (GO[$1] !~...
309
Posted By RudiC
Sometimes, reading man pages really helps. man...
Sometimes, reading man pages really helps. man sed:
Looks like you need to escape the first colon.
235
Posted By RudiC
You are right - the pos variable is split into...
You are right - the pos variable is split into the var array. Then, in all input lines ($0), gensub (a specific gawk function) replaces the characters (no matter what they are!) at the positions in...
579
Posted By RudiC
I think it is sorted properly as sort has been...
I think it is sorted properly as sort has been told. If you want the result in descending order, use the -r (reverse) flag.


How about

{ read; echo $REPLY; sort -t"|" -k7bgr; }...
579
Posted By RudiC
You need to tell sort the correct field...
You need to tell sort the correct field delimiter. Try
sort -t"|" -k7g /tmp/salary.txt (you see - no useless catneeded)


Unfortunately, sort doesn't offer special header treatment. You'll need...
389
Posted By RudiC
Did you consider the join command, made for...
Did you consider the join command, made for exactly this case? Like
join -1 1 -2 2 -t, ServerInfo.csv ConfigFormat.csv
Showing results 1 to 25 of 500

 

Featured Tech Videos