Do you know why this script does nothing?
Auke Kok
sofar at foo-projects.org
Fri Oct 13 04:01:29 UTC 2006
Zbigniew Luszpinski wrote:
> for f in "`find . -name DETAILS`"; do
> sed -i -e 's at ftp://ftp.x.org/pub/X11R7.0/@$XORG_URL/X11R${VERSION}/@g'
> "$f" > /tmp/tymczas;
> mv /tmp/tymczas "$f";
> done
>
> This script should find all DETAILS files in xorg-7.0 and change url patch.
> None of files are modified. What' wrong with it?
>
> I tested for - returns correct files. Then checked sed, replaces strings.
> Finally checked mv, moves files. Everything works. When all these commands
> are put together in one script everythng works except that none of files are
> modified. Arrgh!
as terry said, the trick is '-i'
Alternatively, it all looks a lot easier this way:
find . -name DETAILS -exec sed -i
's at ftp://ftp.x.org/pub/X11R7.0/@$XORG_URL/X11R${VERSION}/@g' {} \;
;)
Cheers,
Auke
More information about the Lunar
mailing list