-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Randal Jarrett wrote:
> I've already been through these cmds and many more but I have been
> unable to come
> up with a combination that will convert the files and then put them in a
> new structure that
> has all the same subdirs that the original has.
> 
> get file, convert file, put file in the same subdir as original but in
> new structure.
> 
> I have the new directory structure built.  That was easy, find . -type d
> -exec mkdir -p ../Dir2/{} \;
> where Dir1 was original and Dir2 is the new structure.
> 
> I just haven't come up with the right combination to put the files in
> the proper subdir under Dir2.
> I'm also having problems with
> 
> 

<snip>

>>
>> Anyway, here are some of the elements you have to work with:
>>
>> - The "find" command
>>   It has an option ("-print0") to print file names with NUL termination
>> instead of the usual newline termination.
>>
>> - The "xargs" command
>>   It has an option ("-0"), a counterpart to find's -print0, that makes
>> it read file names with NUL termination
>>
>> - The "unix2dos" command
>>   This does the basic text file format conversion.
>>
>>

IMHO Not really doable as a single command line, though someone will no
doubt prove me wrong :-) ....

Something like....

find <base directory>/* -type d >scandirs
while read SCANDIR; do
    do stuff with  $SCANDIR
done < scandirs

as a template for a script may work... If you know little about bash
scripting it looks like now is the time to learn....

if the directory structure is not too large putting the results of the
find command in a variable and feeding the variable to a for loop and or
to xargs may work (but xargs does have some limitations).

This is only a pointer to an approach...

BTW Please think before you place your answer, I am personally not
particularly religious about the Top Post vs Bottom Post argument...
(Strikes me as rather like the big-endian vs little-endian war in
Gullivers Travels) but it is a good idea to try an retain something
resembling a consistent flow to the history of an argument when
replying.....

Probably time to put on the asbestos underwear :-)

<snip>




- --
==============================================================================
I have always wished that my computer would be as easy to use as my
telephone.
My wish has come true. I no longer know how to use my telephone.

Bjarne Stroustrup
==============================================================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHWRIgasN0sSnLmgIRAlhDAJ9MVozGMNhFxTUvtBjVC/HydAfXgwCcDHGu
IVm3htF7iRg2CcuwVwFtgKE=
=Kt+p
-----END PGP SIGNATURE-----
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to