I ran it (well, with ls -a -l), it worked. agitato was asking for the 5th item in each list i think. shell outputs the lines as seperate messages.
-
Inteface Pd with Shell scripts?
-
@sebfumaster said:
I ran it (well, with ls -a -l), it worked. agitato was asking for the 5th item in each list i think. shell outputs the lines as seperate messages.
I ran the attached patch and got first the "$5: argument number out of range" error agitato reported, then a series of "print: <float>" lines where <float> was a number, mostly 4096. I got several sets of those, probably one for each file in the directory being listed. What do you get?
-
it seems like shell sometimes splits lines for no reason? but again, other than that it seems like this list of floats is what agitato was trying to get. and as I mentioned when ls outputs the total on the first line some simple
or [once] logic would fix the error, though I'm not sure why [shell] splits some lines and not others.
-
@sebfumaster said:
but again, other than that it seems like this list of floats is what agitato was trying to get.
Ah, the 4096 values the patch prints are indeed the directory sizes, and are what agitato was looking for. The [shell] docs didn't indicate it output line by line, just that it bangs the right outlet when complete. Yes, it does have some bug where it splits some lines, and it looks like it sends a 0, not a bang, to the right outlet when complete.
So your patch is the correct answer, and your [$n( filter on [shell] output is a good technique. How would you alter the test patch I attached earlier to pull just, say, the 3rd line output from [shell]? Or better yet, the xth line, as specified dynamically by the patch during runtime?
-
seems like theres more than 1 bug: this works for me sometimes but sometimes does nothing but output 0 from the right. I was also noticing this when I was testing the above as well. but if shell worked this patch would I think