Search Results

Search: Posts Made By: jeppe83
4,018
Posted By jeppe83
Thank you for clarifying and for your example!
Thank you for clarifying and for your example!
4,018
Posted By jeppe83
Thank you! eval works well for this particular...
Thank you! eval works well for this particular purpose!

Can you elaborate on why it isn't good practice this way?

I not familiar with arrays, so i can't figure out how to implement it on the...
4,018
Posted By jeppe83
'Dynamic' setting of variables in bash script
Hi all,

I want to dynamically set variables in a bash script. I made a naive attempt in a while loop that hopefully can clarify the idea.

n=0; echo "$lst" | while read p; do n=$(($n+1));...
1,109
Posted By jeppe83
Thank you, the for loop did the trick! Why do I...
Thank you, the for loop did the trick! Why do I need the test command?

The while loop produced some strange results. It only processed half the files and gave read/write permissions for output...
1,109
Posted By jeppe83
Help with bash array
Hi, I would like to remove audio tracks from several video clips contained in a single directory using the command
files=(*.mpg); ffmpeg -i "${files[@]}" -vcodec copy -an na/output.mpg
I want each...
1,051
Posted By jeppe83
Thank you. Just what I was looking for!
Thank you. Just what I was looking for!
1,051
Posted By jeppe83
Number some lines discard others?
Hi,
I'd like to do an operation on text with a format like this


this line shall be numbered
this line shall not be numbered
this line shall also be numbered
this line shall not...
7,532
Posted By jeppe83
My word list is derived from a corpus (a large...
My word list is derived from a corpus (a large collection or various real-world language - newspaper articles, novels etc.)

Many such corpora are morphologically marked, so it's easy to extract...
7,532
Posted By jeppe83
not anymore. #!/bin/bash while IFS=...
not anymore.


#!/bin/bash
while IFS= read -r WORD
do
AG=$(echo "$WORD" | awk 'NR==1{w=$0; l=split(w,W)} length==l{for(i=1;i<=l;i++)if(gsub(W[i],"&",w)!=gsub(W[i],"&"))next;print}' FS= -...
7,532
Posted By jeppe83
Perfect! thanks. So far i have this, which...
Perfect! thanks.

So far i have this, which produces many anagrams fast.


#!/bin/bash
#anagramfinder
while :
do
#WORD=$1
WORD=$(shuf -n 1 /data/korpus2k/ordliste)
AG=$(echo "$WORD" | awk...
7,532
Posted By jeppe83
I realize I don't need to generate all...
I realize I don't need to generate all combinations, but I would like to know how anyway.

It's not homework. I'm a linguist and years ago I followed a course "information technology for...
7,532
Posted By jeppe83
Thank you. There's some syntax I don't...
Thank you.

There's some syntax I don't (yet) understand.

It works slower than my rough "try a random permutation and see if it matches a word that isn't the same" script.

Ideally, I would...
7,532
Posted By jeppe83
That certainly sounds like a much better...
That certainly sounds like a much better solution. Thanks

Can you supply some hints how to achieve this? I'm not an experienced scripter..
7,532
Posted By jeppe83
It seems sort -R works faster than shuf.. ...
It seems sort -R works faster than shuf..

I'm experimenting with a script that finds anagrams.

So far this does the job:


#!/bin/bash
#anagramfinder
while :
do
WORD=$(shuf -n 1...
7,532
Posted By jeppe83
Thank you. Just what I was looking for! I...
Thank you. Just what I was looking for!

I replaced sort -r with shuf, so I could use it for iteration.


jeppe@space:/$ while :;do echo "palindrom" | fold -w 1 | shuf | tr -d '\n';echo;done...
7,532
Posted By jeppe83
Randomize letters
Hi,

Is there a tool somewhat parallel to rev, but which randomizes instead of reverses?

I've tried rl, but I can only get it to randomize words.

I was hoping for something like this

echo...
1,508
Posted By jeppe83
Verticalize lines?
Hi,

I need a way to convert horizontal lines like these
0101
1010
1100

to vertical lines like these
0 1 1
1 0 1
0 1 0
1 0 0

Any help will be much appreciated
Showing results 1 to 17 of 17

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