Search Results

Search: Posts Made By: rdcwayx
3,594
Posted By rdcwayx
It is not solved by above code. if you have...
It is not solved by above code. if you have several lines, you calculate wrong.

try this:
grep -o "\." infile|wc -l
awk '{sum+=gsub(/\./,"")}END{print sum}' infile
4,298
Posted By rdcwayx
ls ba[aeiou]*
ls ba[aeiou]*
2,527
Posted By rdcwayx
how about this, it is not exact for your request,...
how about this, it is not exact for your request, but get mostly.

perl -l40pe 's/^-+/\n/' svn.log|awk -F \| '{$3=""}1'

r7351 user01 2 lines Changed paths: D /trunk/demo/proj1/.project ...
1,253
Posted By rdcwayx
awk 'NR>2{$0="NEW" RS $0}1' saved_doc
awk 'NR>2{$0="NEW" RS $0}1' saved_doc
2,364
Posted By rdcwayx
awk 'NR==FNR{a[$1 FS $2];next} !($1 FS $2 in a)'...
awk 'NR==FNR{a[$1 FS $2];next} !($1 FS $2 in a)' file2 file1

sc2/10 10 . G C 50 F=5;U=4
sc2/24 24 . T G 31 F=5;U=4
sc2/11 30 . A T 60 F=5;U=4
2,456
Posted By rdcwayx
so what's the reason to set another array b? ...
so what's the reason to set another array b?
awk '{a[$0]++} END{for(i in a){if (a[i]==1) {print i}}}' infile
2,121
Posted By rdcwayx
awk '{printf (/^\|/)?$0:RS $0}' infile
awk '{printf (/^\|/)?$0:RS $0}' infile
1,780
Posted By rdcwayx
#!/bin/bash # Put Values in an myarrayname and...
#!/bin/bash
# Put Values in an myarrayname and read them back
file="file.txt" # input filename

while read line ;do
wardevent=${line:3:2} # find the wardells...
1,648
Posted By rdcwayx
I don't review the logic with better arithmetic,...
I don't review the logic with better arithmetic, I just provide the same function for shorter script as same as in your code

cat test.sh

echo $1|awk '{if ($5=="24") print $1,$2,$3, "0/24"
...
1,160
Posted By rdcwayx
awk -F "[=,]" '{delete a printf...
awk -F "[=,]" '{delete a
printf $1 "="
for (i=2;i<=NF;i++) a[$i]
for (i in a) printf i ","
printf RS}' infile |sed 's/,$//'
1,561
Posted By rdcwayx
recommend to move below lines to BEGIN{} part in...
recommend to move below lines to BEGIN{} part in awk, which will avoid to gsub on each line again.

gsub ( "-", X, ST )
gsub ( "-", X, EN )
1,606
Posted By rdcwayx
this command is so dangerous, if string is not...
this command is so dangerous, if string is not defined correctly (empty), the whole three folders will be deleted directly without any prompt by "rm -rf"

---------- Post updated at 01:51 PM...
2,270
Posted By rdcwayx
could you please show me this command and its...
could you please show me this command and its ouput?

echo $LANG
3,425
Posted By rdcwayx
see the explanation: ...
see the explanation:
https://www.unix.com/302678079-post2.html
3,781
Posted By rdcwayx
But what's the reason to put file1 first?
But what's the reason to put file1 first?
3,781
Posted By rdcwayx
awk 'NR==FNR{ if ($2~/\$/) {sub(/\$/,"",$2); if...
awk 'NR==FNR{ if ($2~/\$/) {sub(/\$/,"",$2); if (/paid/) {a[$1]+=$2} ;if (/due/) a[$1]-=$2}}
NR>FNR{printf "%s balance:$%.2f \n",$1,a[$1]+0}' file2 file1

CoCo balance:$-10.65
Hiel...
3,781
Posted By rdcwayx
How about it? awk...
How about it?
awk '{sub(/\$/,"",$2)}/paid/{a[$1]+=$2}/due/{a[$1]-=$2}
END{for (i in a) printf "%s balance:$%.2f \n",i,a[i]}' infile

CoCo balance:$5.40
Euda balance:$45.00
1,795
Posted By rdcwayx
I guess you use the du command with -h option....
I guess you use the du command with -h option. Try -k

du -sk *
1,303
Posted By rdcwayx
awk '/HANDVEL/{print;next}{for (i=1;i<=NF;i=i+2)...
awk '/HANDVEL/{print;next}{for (i=1;i<=NF;i=i+2) print $i,$(i+1)}' infile
2,947
Posted By rdcwayx
$ awk '{for (i=1;i<=NF;i++) if (i<=NR) printf $i...
$ awk '{for (i=1;i<=NF;i++) if (i<=NR) printf $i FS}' infile
1 0 8 9 2 6 6 8 9 6 7 9 4 9 9 9 0 3 4 7 9

$ awk '{for (i=1;i<=NF;i++) if (i<NR) printf $i FS}' infile
0 9 2 6 8 9 7 9 4 9 9 0 3 4 7
3,173
Posted By rdcwayx
awk '{a[$NF]=a[$NF] FS $1}END{for (i in a) print...
awk '{a[$NF]=a[$NF] FS $1}END{for (i in a) print "Assigned Values: " ,a[i] |mailx -s "Group info" i}' infile
2,684
Posted By rdcwayx
ssh hostname "path ksh...
ssh hostname "path ksh HC_Report.ksh>out.html"
2,907
Posted By rdcwayx
go through the ABS (advanced bash scripting...
go through the ABS (advanced bash scripting guide), you should get all the answers.
...
1,007
Posted By rdcwayx
See my reply in your thread: ...
See my reply in your thread:
https://www.unix.com/shell-programming-scripting/209511-shell-script-print-date-no-records.html
2,070
Posted By rdcwayx
I have answered your question in another thread. ...
I have answered your question in another thread.

https://www.unix.com/shell-programming-scripting/209511-shell-script-print-date-no-records.html#post302741713
Showing results 1 to 25 of 405

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