Does drush mung backticks and vertical bars? If not, you could use
cd `ls | grep foo- | head -n 1`
If backticks don't work, but |
, $
, (
and )
do, then you could change the above to
cd $(ls | grep foo- | head -n 1)
If |
doen't work, but $
, (
and )
do, then you could do
cd $(myprog)
where myprog
is a script that you write to determine the directory name.
Also -- I don't understand how you might be able to use find
to help you do a cd
,
but, can you end your -exec
with a +
?