Malte Mundt(deleted)
|
Re: shell script gurus here?
|
Malte Mundt(deleted)
08/20/2009 10:44 AM
post36370
|
Re: shell script gurus here?
> On Wed, Aug 19, 2009 at 11:40:37AM -0400, Malte Mundt wrote:
> > Hi,
> >
> > I have a target embedded filesystem with various QNX files, that on the host
> are in bin, sbin, usr/sbin, etc. On my target they are all in bin. Now I want
> to replicate this setup for another CPU platform.
> >
> > I thought of a shell script that takes the output from ls /bin on the target
> and on the host (mounted via NFS) does a find on /usr/qnx641/target/qnx6/[
> myCPU-arch] and so generates a list of all the files with paths on the host.
> >
> > Then the script would copy all the files from their host locations to a new
> directory bin. This new directory I would then copy to the new, other target.
> >
> > This surely can be done with a smart shell script, but I don't know how to
> do it. It's too long ago that I did some scripts... Anyone know how to do this
> ?
>
> Something like:
>
> find /bin -type f | while read line; do /
> find /usr/qnx641/target/qnx6/x86 ${line} -exec "cp {} /dst" ; done
Yeah... but the second find, like this, finds everything in the directory. However, when I change the line to
find /usr/qnx641/target/qnx6/x86 -name ${line} -exec "cp {} /dst" ; done
it doesn't find anything anymore! What could be the problem? (of course files in bin are cat, etc., and should be found.
.)
- Malte
|
|
|