Search found 37 matches
- Sat Aug 17, 2024 12:07 pm
- Forum: Programming
- Topic: permutation combination by position number in bash?
- Replies: 8
- Views: 815
Re: permutation combination by position number in bash?
Thanks for the script, I have adapted it in bash.
n=5
i=$[50-1]
fact=(1)
for (( k=1; k<n; k++ )); do
fact[$k]=$(( ${fact[$(( k - 1 ))]} * k ))
done
perm=()
for (( k=0; k<n; k ...
- Fri Aug 16, 2024 9:48 pm
- Forum: Programming
- Topic: permutation combination by position number in bash?
- Replies: 8
- Views: 815
Re: permutation combination by position number in bash?
https://www.geeksforgeeks.org/find-the-k-permutation-sequence-of-first-n-natural-numbers/
Have now searched a lot but unfortunately not found a calculation option, although ...
- Fri Aug 16, 2024 12:37 pm
- Forum: Programming
- Topic: permutation combination by position number in bash?
- Replies: 8
- Views: 815
Re: permutation combination by position number in bash?
Came across interesting data that the mathematical basis 9 or 3 reveals, no matter what length the number arrangement has.
I am not further and it is certainly very ...
- Thu Aug 15, 2024 11:48 pm
- Forum: Programming
- Topic: permutation combination by position number in bash?
- Replies: 8
- Views: 815
Re: permutation combination by position number in bash?
how can the combination "312" be calculated only by specifying the number of all elements "3", the maximum possible variants "6" and individual variants position "5"?
It is actually more math than ...
- Thu Aug 15, 2024 4:56 pm
- Forum: Programming
- Topic: permutation combination by position number in bash?
- Replies: 8
- Views: 815
permutation combination by position number in bash?
If 4312 comes in position 23, can this combination be found just by calculating the sequence number 23 without comparing and running through all possible sequences?
Otherwise it takes too long with bash ...
- Wed Oct 25, 2023 1:46 pm
- Forum: Programming
- Topic: How to get multiple video volume at different time intervals?
- Replies: 2
- Views: 442
Re: How to get multiple video volume at different time intervals?
In the description for atrim on a help page it says that it is possible with ...
- Mon Oct 23, 2023 11:51 am
- Forum: Programming
- Topic: How to get multiple video volume at different time intervals?
- Replies: 2
- Views: 442
How to get multiple video volume at different time intervals?
With "aselect=between(...)+between(...)..." the script takes a very long time if the file is larger.
I tried using ffmpeg and volumedetect, but then the script would also have to process the file several times in the for loop.
My idea is to ...
- Sun Jul 16, 2023 5:48 am
- Forum: Programming
- Topic: How to bash sort files numerically correctly in awk? (Solved)
- Replies: 8
- Views: 850
Re: How to bash sort files numerically correctly in awk?
Thanks for the help, now it clicked =).
ar0="musica 10 00.mp3\nmusica 10 01.mp3\nmusica 8 00.mp3\nmusica 8 01.mp3\nmusicb 11 00.mp3\nmusicb 11 01.mp3\nmusicb 2 00.mp3\nmusicb 2 01.mp3\nmusicb 5 00.mp3\nmusicb 5 01.mp3"
time echo -e ...
- Sat Jul 15, 2023 6:44 pm
- Forum: Programming
- Topic: How to bash sort files numerically correctly in awk? (Solved)
- Replies: 8
- Views: 850
Re: How to bash sort files numerically correctly in awk?
In the logical order, not the one given by the system.
correct: 1,2,3,4,5,6,7,8,9,10,11,12,...
wrong: 1,10,11,12,13,14,15,16,18,19,2,20,...
- Sat Jul 15, 2023 3:05 pm
- Forum: Programming
- Topic: How to bash sort files numerically correctly in awk? (Solved)
- Replies: 8
- Views: 850
How to bash sort files numerically correctly in awk? (Solved)
Please help.
musica 1 00
musica 5 00
musica 10 00
musicb 2 00
musicb 18 00
...
ar0="musica 10 00.mp3\nmusica 10 01.mp3\nmusica 8 00.mp3\nmusica 8 01.mp3\nmusicb 11 00.mp3 ...
- Fri May 26, 2023 9:23 am
- Forum: Programming
- Topic: Bash: digital numbers in bash without awk, bc, expr, printf
- Replies: 2
- Views: 779
Re: digital numbers in bash without awk, bc, expr, printf
Wow thank you, I made it really awkward before.
- Thu May 25, 2023 7:42 pm
- Forum: Programming
- Topic: Bash: digital numbers in bash without awk, bc, expr, printf
- Replies: 2
- Views: 779
Bash: digital numbers in bash without awk, bc, expr, printf
The first variant does not come over "9223372036854775808" as with "echo -e $[2**63+1]" returns 0 again from the limit.
The second variant multiplies only the crossing points of two single digits, then puts them together ...
- Tue Dec 13, 2022 4:06 pm
- Forum: Programming
- Topic: python or bash snapshot current cpu realtime binary calculations
- Replies: 5
- Views: 627
Re: python or bash snapshot current cpu realtime binary calculations
Ok I was hoping there is a way to read out current data directly without assambler. Thanks anyway.
- Fri Dec 09, 2022 10:48 am
- Forum: Programming
- Topic: python or bash snapshot current cpu realtime binary calculations
- Replies: 5
- Views: 627
Re: python or bash snapshot current cpu realtime binary calculations
It should be just a short excerpt, and show a few recent reactions of the program code processing.
A few MB is more than enough, where /proc or /sys or in /dev can the kernel be read?
- Tue Nov 29, 2022 7:18 pm
- Forum: Programming
- Topic: python or bash snapshot current cpu realtime binary calculations
- Replies: 5
- Views: 627
Re: python or bash snapshot current cpu realtime binary calculations
Ok, it seems to be impossible.
But how can I read out the memory in a short moment?
- Fri Nov 25, 2022 4:30 pm
- Forum: Programming
- Topic: python or bash snapshot current cpu realtime binary calculations
- Replies: 5
- Views: 627
python or bash snapshot current cpu realtime binary calculations
A snapshot of the current realtime cpu calculations in binary, i.e. the complete system working code from the processor.
Only a short excerpt may be possible at intervals, otherwise the work of the selection program would ...
- Fri Oct 28, 2022 2:44 pm
- Forum: Programming
- Topic: bash how filter non showable uncode chars?
- Replies: 8
- Views: 721
Re: bash how filter non showable uncode chars?
Yes, that would be an idea, but I don't know if all visible characters can be displayed in a file.
In geany, the complete text is deleted and an error is displayed with other editors.
Well, but it worked out so thank you again.
- Thu Oct 27, 2022 10:04 am
- Forum: Programming
- Topic: bash how filter non showable uncode chars?
- Replies: 8
- Views: 721
Re: bash how filter non showable uncode chars?
Thanks for the improvement, I've changed it now.
therefore, I have to realize that it is not possible with bash, and the blocks can only be deleted manually.
in this sense, the main thing is save, the man himself.
- Mon Oct 24, 2022 2:41 pm
- Forum: Programming
- Topic: bash how filter non showable uncode chars?
- Replies: 8
- Views: 721
Re: bash how filter non showable uncode chars?
I made this here, but is there a faster or better way to compare + filter the characters?
str='ɨɆ01ab!?🙏'
for ((z=0; z<${#str}; z+=1)); do
for y in $(fc-list : family | sort | uniq); do
for x in $(fc-match --format="%{charset ...
- Sun Oct 23, 2022 6:47 pm
- Forum: Programming
- Topic: bash how filter non showable uncode chars?
- Replies: 8
- Views: 721
bash how filter non showable uncode chars?
With the code I can display, but not filter them out.
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>25001 && NR<27000) {gsub(/\//, "\\\\"); system("/usr/bin/echo -ne "$2" | grep -oP ...
- Thu Jul 21, 2022 7:42 am
- Forum: Programming
- Topic: bash using awk and amp to write between the passing variable
- Replies: 10
- Views: 1322
- Wed Jul 20, 2022 4:48 pm
- Forum: Programming
- Topic: bash using awk and amp to write between the passing variable
- Replies: 10
- Views: 1322
Re: bash using awk and amp to write between the passing variable
results="02:43 (03:36)945+7 :0+1+07:37 - 08:59 (01:21)"
echo "02:43 (03:36)945 7 :0 1 07:37 - 08:59 (01:21)" | awk '{a=gensub(/([[:digit:]]) ([[:digit:]])/, "+\\1+1\\1", "g"); print a}'
- Mon Jul 18, 2022 11:39 am
- Forum: Programming
- Topic: bash using awk and amp to write between the passing variable
- Replies: 10
- Views: 1322
Re: bash using awk and amp to write between the passing variable
# example
echo "a:b:cd" | awk -F "" '{print $1"0"$2"1"$3"0"$4"1"$5}'
echo "a:b:cd" | awk '{gsub(/:b:c ...
- Sun Jul 17, 2022 3:09 pm
- Forum: Programming
- Topic: bash using awk and amp to write between the passing variable
- Replies: 10
- Views: 1322
bash using awk and amp to write between the passing variable
can the variable passed by the amp be shortened, for ...
- Sun Apr 17, 2022 3:07 pm
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>42 && NR<1135) {gsub(/\//, "\\\\"); a=system("/usr/bin/echo -ne "$2); gsub(/\\\\/, " ", $2); print " "$2" "substr($1, 3, 4)" "$3" "$4" "$5" "$6" "$7" "$8" "$9}}'
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if(NR>42 && NR ...
- Sat Apr 16, 2022 10:37 am
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '/\/x/ {if(NR>41 && NR<1138) {gsub(/\/x/, "", $2); system("/usr/bin/echo -e \\\\u"$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9)}}'
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '{if ...
- Fri Apr 15, 2022 9:55 pm
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk '/\/x/ {if(NR>41 && NR<138) {gsub(/\/x/, "", $2); system("/usr/bin/echo -e \\\\x"$2"")}}'
zcat /usr/share/i18n/charmaps/UTF-8.gz | awk ...
- Fri Apr 15, 2022 6:30 pm
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
Yes it worked well I just noticed it now.
Thanks for solving the problem.
- Fri Apr 15, 2022 12:27 pm
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
Sorry, Echo runs normally for me and I also get "a" from "echo -e \\U61" but I was hoping that I can use echo instead of prinf in awk.
- Wed Apr 13, 2022 1:41 pm
- Forum: Programming
- Topic: Bash echo within awk hex conversion?
- Replies: 29
- Views: 5097
Re: Bash echo within awk hex conversion?
have Awk 5.1.0 Copyright © 1989, 1991-2020