Search Results

Search: Posts Made By: sandwich
5,470
Posted By sandwich
yes good question i have used grep -c...
yes good question i have used

grep -c "^[%]" vtipy.txt
and the number was 2126

vtip=$RANDOM
let "vtip=1+(vtip%2125)" #thats why here is 2125 it is modulo
awk -v cislo=$vtip...
5,470
Posted By sandwich
Very nice ironmask2004 it is great too .... ...
Very nice ironmask2004 it is great too ....

I have just finished it with the previous solution
vtip=$RANDOM
let "vtip=1+(vtip%2125)"
awk -v cislo=$vtip '/%/{p++;next}p==cislo' vtipy.txt
5,470
Posted By sandwich
Thank you very much Scrutinizer.... this helped...
Thank you very much Scrutinizer.... this helped me a lot...

awk '/%/{p++;next}p==1{print}' infile
5,470
Posted By sandwich
choose random text between constant string.. using awk?
Hallo
I have maybe a little bit advanced request....
I need to choose one random part betwen %....

so i have this..

%
text1 text1 text1
text1 text1 text1
text1 text1 text1
%
text2...
Showing results 1 to 4 of 4

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