Search Results

Search: Posts Made By: danmero
1,938
Posted By danmero
Ops, my error on on post 4 , however originally...
Ops, my error on on post 4 , however originally run on Linux and no errors , later on BSD yield error

# uname -a
Linux ela.2.4.b 2.6.18-348.1.1.el5 #1 SMP Tue Jan 22 16:24:03 EST 2013 i686 i686...
1,938
Posted By danmero
Good to see you, I have to come back to refresh...
Good to see you, I have to come back to refresh my memory from time to time :D


i is not an action.

i=i, this will assign the value of i variable to i variable, useless acction.
1,465
Posted By danmero
This file follow the rules "Don't put all eggs in...
This file follow the rules "Don't put all eggs in one basket" :)
Is part of a script to bruteforce scan/"crack" an SMTP server but the function called CrackSMTP() is not in the file :cool:
1,938
Posted By danmero
Hi Scrutinizer, you are right about array...
Hi Scrutinizer, you are right about array traversal.
------
Regarding the loop , works on my BSD
# uname -a
FreeBSD sn.route 8.3-RELEASE-p16 FreeBSD 8.3-RELEASE-p16 #0: Mon Aug 25 08:25:41 EDT...
1,576
Posted By danmero
Hi Don Cragun, your solution is simpler and run...
Hi Don Cragun, your solution is simpler and run 30% faster that my. Thanks.
Forum: Programming 02-28-2016
4,353
Posted By danmero
For windows I will go with "deltacopy over ssh" ,...
For windows I will go with "deltacopy over ssh" , but you can take a look at WinSCP >> Scripting and Task Automation (http://winscp.net/eng/docs/scripting#example)
1,576
Posted By danmero
awk -F'[<>]' '/pokl/{split($3,a,"[,|=]");printf...
awk -F'[<>]' '/pokl/{split($3,a,"[,|=]");printf "%s ",a[6];for(i=1;i<5;i++){getline;printf "%s%s",$3,(i==4)?RS:";"}}' file
1,894
Posted By danmero
https://www.gnu.org/software/gawk/manual/html_node...
https://www.gnu.org/software/gawk/manual/html_node/Controlling-Array-Traversal.html

Base on my experience by default awk will use incremental traversal , maybe I'm wrong.
1,394
Posted By danmero
awk '/\"/{for(i=2;i<=NF;i+=2){print $i}}' FS=\" ...
awk '/\"/{for(i=2;i<=NF;i+=2){print $i}}' FS=\" file
1,894
Posted By danmero
;)# cat A.txt UID,HD1,HD2,HD3,HD4 ...
;)# cat A.txt
UID,HD1,HD2,HD3,HD4
1,2,33,44,55
2,10,14,15,16
# cat B.txt
UID
HD1
HD4

Solution

# awk 'FNR==NR{h[$0]=$0;next}FNR==1{for(;i++<NF;){if($i==h[$i]){o[l++]=i}}}{for(_ in...
1,938
Posted By danmero
awk...
awk 'END{$1="Total";for(i=1;i++<NF;){$i=sum[i]};print}{for(i=1;i++<NF;i){sum[i]+=$i}}NR==1' OFS="\t" F.txt
2,280
Posted By danmero
Base on your data sample try the following...
Base on your data sample try the following one-liner
awk 'END{for(l=1;l++<NF;)print o[l]}{for(l=I;l++<NF;){o[l]=((o[l])?o[l]FS:S)$l}}' file


Since this is your first post please read and...
13,242
Posted By danmero
Can you post a real sample data and in the same...
Can you post a real sample data and in the same time state your OS & version
13,242
Posted By danmero
sort -ut '|' -k 1,2 file.txt
sort -ut '|' -k 1,2 file.txt
2,241
Posted By danmero
cat *1.txt > new_file or paste *1.txt >...
cat *1.txt > new_file
or
paste *1.txt > new_file
1,450
Posted By danmero
awk '/^2011-12-26 14:37/,/^2011-12-26 14:58/' file
awk '/^2011-12-26 14:37/,/^2011-12-26 14:58/' file
4,278
Posted By danmero
Using tr echo "345 897 567 098 123" | tr \ ...
Using tr
echo "345 897 567 098 123" | tr \ \\\n

---------- Post updated at 06:42 AM ---------- Previous update was at 06:41 AM ----------

Already suggested by balajesuri ;)
2,036
Posted By danmero
awk -F"[{}:,]"...
awk -F"[{}:,]" '{for(i=1;i<=NF;i++){if($i==int($i) && length($i)==13){print $i}}}' file
To be more precise ;)
980
Posted By danmero
awk 'END{print...
awk 'END{print a[3],a[4],a[5]}FNR>9{for(i=2;i++<5;) {a[i]+=$i}}' rlx.4000.dump rlx.4050.dump > pos_2
12,316
Posted By danmero
awk 'BEGIN{FS=OFS="|"}{for(i=1;++i<NF;)$i=$i?$i:"...
awk 'BEGIN{FS=OFS="|"}{for(i=1;++i<NF;)$i=$i?$i:" "}1' file
7,050
Posted By danmero
awk 'F &&! NF{exit}/ERROR/{F++}F' file
awk 'F &&! NF{exit}/ERROR/{F++}F' file
2,231
Posted By danmero
for i in x86_64 i686; do while read a x x b...
for i in x86_64 i686; do
while read a x x b c x
do
echo $a $b $c $i
done < $file-$i > processed-$i.log
done
Useless use of awk when the shell can do the job :cool:
1,166
Posted By danmero
awk -F\> '/^#/{_=$NF}{sub(/^seq/,_)}_' file
awk -F\> '/^#/{_=$NF}{sub(/^seq/,_)}_' file
2,253
Posted By danmero
awk...
awk '{x=($1<0)?0:(($1>0)?1:$1);split($0,a);for(i=1;++i<=NF;){split(a[i],b,":");$(b[1]+1)=b[2]};for(i=1;++i<=123;){$i=$i==1?1:0};$1=x}1' OFS="," file
3,732
Posted By danmero
You need only one pattern match to set the value...
You need only one pattern match to set the value to true, after that you can exit.


Check your input and patterns again.
Showing results 1 to 25 of 500

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