Vadim Gritsenko wrote:
Reinhard Poetz wrote:
But now I run into another problem: When I use the find/xargs command,
the working directory is the directory where I entered this command
and not the directory where the create-apidocs.sh script is located.
Is there a way to set the working directory the way I have expected it?
Yep. Put this script say in your home dir, name it 'x.sh' and make it
executable:
#!/bin/sh
cd `dirname $1`
# Both "sh $1" and ". $1" should work
. $1
From your home dir (where x.sh is):
find /x1/www/cocoon.apache.org/2.2 -name "create-apidocs.sh" | grep
apidocs/ | xargs -n 1 ./x.sh
thanks, works like a charm!
Alternatively you can put cd `dirname $1` in each of create-apidocs.sh
but I figured you'd want to avoid this :)
:-)
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------