[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A Simple Scripting Question



On Sunday 08 May 2005 06:36, Byron Hillis wrote:
> Hi everybody,
>
> A bit off topic, but it is on a Debian machine. Here's the situation. I've
> got a bunch of files layed out like this...
>
> /cvs/proj/src/rs232/rs232.asm
> /cvs/proj/src/rs232/include/rs232_include.inc
> /cvs/proj/src/rs232/include/rs232.inc
> /cvs/proj/src/a2d/a2d.asm
> /cvs/proj/src/a2d/include/a2d_include.inc
> /cvs/proj/src/a2d/include/a2d.inc
> /cvs/proj/src/a2d/include/a2d_constants.inc
> /cvs/proj/src/servo/servo.asm
> /cvs/proj/src/servo/include/servo.inc
> /cvs/proj/src/servo/include/servo_constants.inc
>
> What I want is the ability to create symlinks in another location so that
> it looks like this.
>
> /code/rs232.asm
> /code/a2d.asm
> /code/servo.asm
> /code/include/rs232_include.inc
> /code/include/rs232.inc
> /code/include/a2d_include.inc
> /code/include/a2d.inc
> /code/include/a2d_constants.inc
> /code/include/servo.inc
> /code/include/servo_constants.inc
>
> Where each file is a symlink to the original. I don't need someone to give
> me a script to do this (although that would be nice), but maybe just some
> guidance as to where to start looking. I think I could use something like
> find piped into a grep statement and then...that's where I get lost.
>
> Anybody got any ideas? Thanks,
>
> Byron
You can do it with hard links with cp -alf

something like

cp -alf /cvs/proj/src/rs232/* /code
cp -alf /cvs/proj/src/a2d/* /code
cp -alf /cvs/proj/src/servo/* /code


I use a technique like this to merge stuff into an archive in my backup script

-- 
Alan Chandler
http://www.chandlerfamily.org.uk



Reply to: