[PD] how to check, if file is existing or not

Jamie Bullock jamie at postlude.co.uk
Mon Jun 21 14:25:00 CEST 2004


CR,

Interesting. I never knew this very useful (hidden?) external existed.

I tried your suggestion under Linux, using a message object to send 
/home/test into the bash.... inlet, and I get:

print: bash -c 'test -e `echo\ $1` && echo yep || echo nop


as output.

However, I believe this is because message box variable substitution 
needs  its inlet data to be formatted using:

symbol /home/test


going into

bash -c 'test -e $1 && echo yep|| echo nop'


Then variable substitution works fine, but when this is sent to the 
shell object, I get:

-e: -c: line 1: unexpected EOF while looking for matching `''

-e: -c: line 2: syntax error: unexpected end of file



I think this may be something to do with the way the shell object parses 
its data (??), as it seems fine with simple commands, but not with 
commands involving special characters, comparisons, output redirection etc.

Anybody else played with this object or got more info?

Jamie








cr wrote:

>i use bash for this., via the shell external (linux version in CVS, windows version at http://whats-your.name/pd/extra/shell/ ) - sent a message like:
>
>bash -c 'test -e "`echo $1`" && echo yep|| echo nop
>
>followed by a 'select' object to determine which course of events to take...
>
>the only reason you have to backtick the "echo $1" instead of just doing a test -e "$1" is due to pd not otherwise substituting the $1 with an actual live value...im not sure if thats a bug or a feature, but the above works for me....
>
>cr
>
>  
>





More information about the Pd-list mailing list