I'm trying to implement a decent random string generator in my buildfile using the following ExecTask :
<exec command="cat /dev/urandom | tr -cd '[:alnum:]' | fold -w30 | head -n1" returnProperty="random" />
While this works fine when run on the command line, it causes my build script to just hang when I try and call it from Phing. I've tried various escape patterns to no avail. What am I doing wrong?
Try setting the escape to false. Also, you might want to try to use passthru.
Here is the phing documentation, with the available options you can pass to exec.
https://www.phing.info/docs/guide/trunk/ExecTask.html
And when should you use passthru.
PHP - exec() vs system() vs passthru()