Subject: Re: how to use 'cd' in a do-* target
To: Mark E. Perkins <>
From: Rhialto <>
List: tech-pkg
Date: 07/24/2005 14:36:42
On Sun 24 Jul 2005 at 07:29:53 -0400, Mark E. Perkins wrote:
> The problem is that this chokes on 'cd ${FILESDIR}' as follows:

It can't work anyway, since each line is executed in a new fresh shell,
so that the cd has no effect on the next command. You should make it all
into one big command, something like

 	cd ${FILESDIR};			\
 	${FETCH_CMD} path/to/file1;	\
 	${FETCH_CMD} path/to/file2;	\
 	${FETCH_CMD} path/to/file3;	\
 	${FETCH_CMD} path/to/file4;

> bmake fetch
> /bin/mkdir -p /Volumes/NetBSD/pkgsrc/local/testproj/files
> cd /Volumes/NetBSD/pkgsrc/local/testproj/files
> bmake: Exec of `cd' failed (No such file or directory)
> *** Error code 1

It looks like your command line is not executed with "sh -c" but bmake
tries to run it directly???

> Mark
___ Olaf 'Rhialto' Seibert      -- You author it, and I'll reader it.
\X/ rhialto/at/        -- Cetero censeo "authored" delendum esse.