cat question

hello! why this works?

cd /home/user
cat * | ecasound -i stdin -o jack

and this doesn't?

cd /home/user/somedirectory
cat * | ecasound -i stdin -o jack

somedirectory are full with exe files which are the best source for this sort of noise thing

Unless you define what "doesn't work" means, it's possible that no one can help you.

cat * will exapnd to cat file1 file2... file1, file2 etc files being in the current directory. So chances are there that the "somedirectory" is empty!

--ahamed

We appear to have a different understanding of the meaning of

:wink:

i mean first example "cat's" files in my home directory to my soundcard and makes noise but second example throws error
cat: invalid option -- ' '
so how to use subfolder in home directory and cat all files from that directory to | ecasound -i stdin -o jack?

Oops... I missed that part!... :o

--ahamed

Perhaps you have a file name '-- '?

$ touch -- '-- '
$ cat *
cat: unrecognized option `-- '
Try `cat --help' for more information.

somedirectory is full with random exe files (3GB) that i specifically collected for my cat to soundcard experiments...
so many, many filenames
i am not programmer and have very limited shell knowledge
so i don't know what to do
i also have this example that supposed to find all the .exe files on my computer i guess..
find . -name '*.exe' -exec cat {} > /dev/audio \;

but i dont know how to substitute /dev/audio \; part
with | ecasound -i stdin -o jack
any ideas?
thank you for responses

Did you try cat *.exe | ecasound -i stdin -o jack ?

You can try:

 
find . -name '*.exe'  -print | xargs ecasound -i stdin -o jack 

Do let us know if this works... I am not sure if I can pass the argument to ecasound command like that. But still I hope this should work :slight_smile:

In case xargs doesn't work, feed the file name directly to the "ecasound" command:

cd /home/user/somedirectory
find . -type f -name '*.exe'  -print | while read filename
do
            ecasound -i "${filename}" -o jack
done