[opensuse] Need help doing a batch conversation lf - cr/lf
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf). I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system and then move them to the win server. I also have to maintain the original files & structure. Any and all assistance is appreciated. -- Randal Jarrett <rsj@radio.org> Randy's Ham Shack -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 * Randal Jarrett <rsj@radio.org> [12-06-07 18:49]:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
unix2dos unix2dos --help unix2dos 2.2 Copyright (c) 1994-1995 Benjamin Lin. (1995.03.31) Usage: unix2dos [-hkqV] [-o file ...] [-c convmode] [-n infile outfile ...] -h --help give this help -k --keepdate keep output file date -q --quiet quiet mode, suppress all warnings always on in stdin->stdout mode -V --version display version number -c --convmode conversion mode convmode ASCII, 7bit, ISO, default to ASCII -o --oldfile write to old file file ... files to convert in old file mode -n --newfile write to new file infile original file in new file mode outfile output file in new file mode - -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHWI2wClSjbQz1U5oRArJGAKCT6x4TKRMjrZ0DXizolAupNt0ElACbBdsN ymWmfYqEflVRe7Qah4fksnw= =fulL -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 06 December 2007 15:42, Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
Does telling you to never, ever use Windows count as assistance? No matter, I use it too... 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. Check 'em out.
-- Randal Jarrett <rsj@radio.org>
Dude! Do you know you spell your name wrong?? Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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 On Thu, 2007-12-06 at 16:13 -0800, Randall R Schulz wrote:
On Thursday 06 December 2007 15:42, Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
Does telling you to never, ever use Windows count as assistance? No matter, I use it too...
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.
Check 'em out.
-- Randal Jarrett <rsj@radio.org>
Dude! Do you know you spell your name wrong??
Randall Schulz --
Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----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: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Thanks for the template. I'll add it to the others and see if I can get something to work. As for the top vs bottom reply, as you said it is a personal thing. I prefer the top reply. this allows me to see the answer to the reply in the preview window without having to scroll down the whole message that I had previously read. On Fri, 2007-12-07 at 09:28 +0000, G T Smith wrote:
<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----- --
Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randal Jarrett wrote:
Thanks for the template. I'll add it to the others and see if I can get something to work.
As for the top vs bottom reply, as you said it is a personal thing.
I prefer the top reply. this allows me to see the answer to the reply in the preview window without having to scroll down the whole message that I had previously read.
On Fri, 2007-12-07 at 09:28 +0000, G T Smith wrote:
<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-----
UH OH! Here we go again. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 07 December 2007 12:54:54 pm Randal Jarrett wrote:
Thanks for the template. I'll add it to the others and see if I can get something to work.
As for the top vs bottom reply, as you said it is a personal thing.
I prefer the top reply. this allows me to see the answer to the reply in the preview window without having to scroll down the whole message that I had previously read.
Randal, It is nice that you have your personal preference. However, please allow me to give you some advice. I am not a "list police" or whatever. Many new subscribers don't know the protocol of this list. That is, that in this list we prefer bottom posting. We don't even look at the top. We look at the flow of information in a logical mmanner.When we reply we trim unneccessary information and bottom post. That is the way it has been for many years and will always remain so. You are only hurting yourself with top-posting. There are several hundred subscribers on this list and a great deal of them are very knowledegable old-timers with a vast amount of expertise and experience who are here to help people with their favorite distro. They get tired of telling the new people to bottom post. So what do these very knowledgeable people do when they see a top post? "Plonk" the request is deleted. No reply from someone who can help you. You seem like an intelligent courteous person. Do us the courtesy of following the protocol of this list. Your choice. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 2007-12-07 at 21:11 -0500, Bob S wrote:
On Friday 07 December 2007 12:54:54 pm Randal Jarrett wrote: ... It is nice that you have your personal preference.
However, please allow me to give you some advice. I am not a "list police" or whatever. Many new subscribers don't know the protocol of this list. That is, that in this list we prefer bottom posting. We don't even look at the top. We look at the flow of information in a logical mmanner.When we reply we trim unneccessary information and bottom post. That is the way it has been for many years and will always remain so.
You are only hurting yourself with top-posting. There are several hundred subscribers on this list and a great deal of them are very knowledegable old-timers with a vast amount of expertise and experience who are here to help people with their favorite distro. They get tired of telling the new people to bottom post. So what do these very knowledgeable people do when they see a top post? "Plonk" the request is deleted. No reply from someone who can help you.
You seem like an intelligent courteous person. Do us the courtesy of following the protocol of this list. Your choice.
Bob S
I never said that I wouldn't bottom post. After my post about my preference I read the List FAQs about bottom posting. I will use it from now on. I really wasn't trying to stir up a hornet's nest. (I did that once in my younger years and learned my lesson). I did notice that several members replied about the top/bottom subject but neglected the list protocol about changing the subject line when going off topic in the message. :-) I won't direct any comments to any individuals about picking one sin to preach about while committing others. ;-) Randal -- Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 08 December 2007 04:22:41 pm Randal Jarrett wrote:
On Fri, 2007-12-07 at 21:11 -0500, Bob S wrote:
On Friday 07 December 2007 12:54:54 pm Randal Jarrett wrote:
...
It is nice that you have your personal preference.
However, please allow me to give you some advice. I am not a "list police" or whatever. Many new subscribers don't know the protocol of this list. That is, that in this list we prefer bottom posting. We don't even look at the top. We look at the flow of information in a logical mmanner.When we reply we trim unneccessary information and bottom post. That is the way it has been for many years and will always remain so.
You are only hurting yourself with top-posting. There are several hundred subscribers on this list and a great deal of them are very knowledegable old-timers with a vast amount of expertise and experience who are here to help people with their favorite distro. They get tired of telling the new people to bottom post. So what do these very knowledgeable people do when they see a top post? "Plonk" the request is deleted. No reply from someone who can help you.
You seem like an intelligent courteous person. Do us the courtesy of following the protocol of this list. Your choice.
Bob S
I never said that I wouldn't bottom post. After my post about my preference I read the List FAQs about bottom posting. I will use it from now on. I really wasn't trying to stir up a hornet's nest. (I did that once in my younger years and learned my lesson).
I did notice that several members replied about the top/bottom subject but neglected the list protocol about changing the subject line when going off topic in the message. :-)
I won't direct any comments to any individuals about picking one sin to preach about while committing others. ;-)
Randal
Randal, "Touche" Welcome to the list. I see you are a neighbor of mine. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 * Bob S <911@sanctum.com> [12-08-07 17:56]:
Welcome to the list.
I see you are a neighbor of mine.
as long as we are kicking netiquette, trimming the quote is part of it! please? one of the biggest throw-backs by the top-posting advocates is not having to page down thru 200 lines of quoted mat'l. Do *your* part. It *will* be appreciated. - -- Patrick Shanahan Plainfield, Indiana, USA HOG # US1244711 http://wahoo.no-ip.org Photo Album: http://wahoo.no-ip.org/gallery2 Registered Linux User #207535 @ http://counter.li.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFHWyJPClSjbQz1U5oRAj6iAJ0WczXAMa0/W2FI47QEx0deQxXqsQCfY2tx 1W2MxocyeUaPCQ3qmeYdzjY= =iF2k -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I did a variation on this and got it to work. I made the top level dir 'Dir2' cd into Dir1 and the 'rsync -va . ../Dir2/ cd into Dir2 find . -type f -name "*.txt" -exec unix2dos "{}" \; that did it. I didn't put the "" around the {} the first time and it barfed on the files with spaces in them. Thanks everybody for all the suggestions. On Fri, 2007-12-07 at 09:28 +0000, G T Smith wrote:
-----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----- --
Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Randal Jarrett (rsj@radio.org) [20071207 06:00]:
get file, convert file, put file in the same subdir as original but in new structure.
Something like; pushd <old top_dir> for f in "$(find <old top dir> -type f)"; do destdir=<new top_dir>/$(dirname $f) file=$(basename $f) if [ ! -d $destdir]; then mkdir -p $destdir fi unix2dos $f $destdir/$file done popd Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Thanks for the info. I'll add it to the rest of the replies and try to come up with something that will work. On Fri, 2007-12-07 at 16:08 +0100, Philipp Thomas wrote:
* Randal Jarrett (rsj@radio.org) [20071207 06:00]:
get file, convert file, put file in the same subdir as original but in new structure.
Something like;
pushd <old top_dir> for f in "$(find <old top dir> -type f)"; do destdir=<new top_dir>/$(dirname $f) file=$(basename $f)
if [ ! -d $destdir]; then mkdir -p $destdir fi unix2dos $f $destdir/$file done popd
Philipp --
Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 06 December 2007 20:59, 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.
...
I have disqualified / recused myself from this exercise. Last night while I was trying to put something together for you, I wiped out 40 critical source files from my current project. Then I discovered that "Keep" (an rdiff-backup frontend) has some ... problems. I was able to manually approximate what Keep's restore operation is supposed to do, but it was a tense hour... Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randall R Schulz wrote:
On Thursday 06 December 2007 20:59, 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.
...
I have disqualified / recused myself from this exercise.
Last night while I was trying to put something together for you, I wiped out 40 critical source files from my current project. Then I discovered that "Keep" (an rdiff-backup frontend) has some ... problems.
I was able to manually approximate what Keep's restore operation is supposed to do, but it was a tense hour...
Oh, geeze. I would think that a man of your age and experience would know create a test directory (or even test directory tree) for such experiments... I hope you were able to recover everything. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 07 December 2007 07:58, Aaron Kulkis wrote:
Randall R Schulz wrote:
...
I was able to manually approximate what Keep's restore operation is supposed to do, but it was a tense hour...
Oh, geeze.
I would think that a man of your age and experience would know create a test directory (or even test directory tree) for such experiments...
Yes. I am a fool.
I hope you were able to recover everything.
Happily, yes. I did have backups. I was just so blinded with terror that I forgot to even look at the rdiff-backup documentation when Keep (a front-end for rdiff-backup) failed. RRS -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Ouch!! it seems that Murphy works overtime when there isn't a good backup of something. On my personal system I don't trust backup programs and keep a couple of extra unmounted drives that my backup script mounts and then does a rsync to one and alternates to the other on the next backup so that if something happens and I loose both the source and dest drives I still have another. Thanks for trying on my behalf. On Fri, 2007-12-07 at 07:33 -0800, Randall R Schulz wrote:
On Thursday 06 December 2007 20:59, 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.
...
I have disqualified / recused myself from this exercise.
Last night while I was trying to put something together for you, I wiped out 40 critical source files from my current project. Then I discovered that "Keep" (an rdiff-backup frontend) has some ... problems.
I was able to manually approximate what Keep's restore operation is supposed to do, but it was a tense hour...
Randall Schulz --
Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Friday 07 December 2007 07:33, Randall R Schulz wrote:
On Thursday 06 December 2007 20:59, Randal Jarrett wrote:
...
I have disqualified / recused myself from this exercise.
Last night while I was trying to put something together for you, I wiped out 40 critical source files from my current project. Then I discovered that "Keep" (an rdiff-backup frontend) has some ... problems.
I was able to manually approximate what Keep's restore operation is supposed to do, but it was a tense hour...
This is what fear does to your mind: Of course, rdiff-backup knows how to restore the backups it creates. Another proud D'Oh! moment for the veteran. RRS -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
use a script as follows: #Description: Add CR to text files' for f do mv $f ${f}.orig && awk '{ printf "%s\r\n", $0 }' ${f}.orig >$f done reverse: # Description: Remove CR and control-Z from text files' for f do mv $f ${f}.orig && tr -d '\015\032' <${f}.orig >$f done rgds. Otto Rodusek -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
Randal Jarrett wrote:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders": My Documents My Music My Pictures Doz DTEs make creating files with spaces in filenames just as easy as not. Some FTP servers perpetuate the insanity by serving application installers with spaces in their filenames: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.11/win32/en-US/ ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/2.0.0.9/win32/en-US/ -- " Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://mrmazda.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 2007-12-07 at 09:06 -0500, Felix Miata wrote:
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
Randal Jarrett wrote:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders":
My Documents My Music My Pictures
Not to mention the horror of insisting on using the "wrong" slash as folder separator. Hans ps. If I had a $ for every mail someone sent me to go and look at \\server\share name\file name E-mail Disclaimer http://www.sunspace.co.za/emaildisclaimer.htm -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hans van der Merwe wrote:
On Fri, 2007-12-07 at 09:06 -0500, Felix Miata wrote:
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^ What idiot did that? The M$ world has taught virtually everyone that spaces in filenames are no
Randal Jarrett wrote: problem. Each M$ user has these "folders":
My Documents My Music My Pictures
The perversity in Redmond knows no bounds ... :-(
Not to mention the horror of insisting on using the "wrong" slash as folder separator.
Hans ps. If I had a $ for every mail someone sent me to go and look at \\server\share name\file name
Yes, a hold-over of backwards compatibility with that toy operating system, CP/M. [And yes, CP/M WAS a toy. It was written by one guy in his basement in the mid-1970's to use on his Altair (*?) Intel 8080 machine, which he distributed freely to hobbyists. Then it was given commercial legitimacy first by Radio Shack (TRS-80), and then MS (Gates bought a slightly extended commercial version and re-branded it PC-DOS]. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
[And yes, CP/M WAS a toy. It was written by one guy in his basement in the mid-1970's to use on his Altair (*?) Intel 8080 machine, which he distributed freely to hobbyists. Then it was given commercial legitimacy first by Radio Shack (TRS-80), and then MS (Gates bought a slightly extended commercial version and re-branded it PC-DOS].
I suggest you get your history right. CP/M was developed by Gary Killdal, a computer science professor, who also did some work for Intel and CP/M was originally written for an Intel system. It was the most successful operating system for the 8080 & Z80 CPU's and also ported to others. Also, it was not a toy distributed freely to hobbyists. It was sold as a commercial product and many businesses used it. There was a lot of commercial software written for CP/M. PC & MS-DOS came about as a result of a company called Seattle Computer Products, which developed Q-DOS as a test system for their hardware, while waiting for CP/M-86 to be available. When IBM was developing the PC, they looked for an operating system. They initially had three, CP/M-86, something called P-code and DOS. Bill Gates sold IBM DOS, before he even owned it. He then went to SCP to buy it, repackaged it with some minor changes and called it DOS 1. IBM called their version "PC-DOS" and the version Microsoft sold to others was called "MS-DOS". Gary Killdal was able to demonstrate in court that DOS contained some CP/M code. The TRS-80 never ran CP/M. It had it's own OS . It also ran a BASIC, sold by Microsoft, as many of the personal computers of the time did. -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
Hans van der Merwe wrote:
On Fri, 2007-12-07 at 09:06 -0500, Felix Miata wrote:
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^ What idiot did that? The M$ world has taught virtually everyone that spaces in filenames are no
Randal Jarrett wrote: problem. Each M$ user has these "folders":
My Documents My Music My Pictures
The perversity in Redmond knows no bounds ... :-(
Not to mention the horror of insisting on using the "wrong" slash as folder separator.
Hans ps. If I had a $ for every mail someone sent me to go and look at \\server\share name\file name
Yes, a hold-over of backwards compatibility with that toy operating system, CP/M.
[And yes, CP/M WAS a toy. It was written by one guy in his basement in the mid-1970's to use on his Altair (*?) Intel 8080 machine, which he distributed freely to hobbyists. Then it was given commercial legitimacy first by Radio Shack (TRS-80), and then MS (Gates bought a slightly extended commercial version and re-branded it PC-DOS].
Forgot to mention. Bill Gates developed a BASIC interpreter for the MITS Altair 8800, while a student at Harvard. He used the Harvard computers for this, despite a ban on developing commercial software on those systems. There is some mention that he also cheated Ed Roberts, the founder of MITS and creator of the Altair. The Altair later had a disk operating system that was not CP/M, though many of them were used with it. -- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Aaron Kulkis wrote:
Hans van der Merwe wrote:
On Fri, 2007-12-07 at 09:06 -0500, Felix Miata wrote:
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^ What idiot did that? The M$ world has taught virtually everyone that spaces in filenames are no
Randal Jarrett wrote: problem. Each M$ user has these "folders":
My Documents My Music My Pictures
The perversity in Redmond knows no bounds ... :-(
Not to mention the horror of insisting on using the "wrong" slash as folder separator.
Hans ps. If I had a $ for every mail someone sent me to go and look at \\server\share name\file name
Yes, a hold-over of backwards compatibility with that toy operating system, CP/M.
[And yes, CP/M WAS a toy. It was written by one guy in his basement in the mid-1970's to use on his Altair (*?) Intel 8080 machine, which he distributed freely to hobbyists. Then it was given commercial legitimacy first by Radio Shack (TRS-80), and then MS (Gates bought a slightly extended commercial version and re-branded it PC-DOS].
Forgot to mention. Bill Gates developed a BASIC interpreter for the MITS Altair 8800, while a student at Harvard. He used the Harvard computers for this, despite a ban on developing commercial software on those systems. There is some mention that he also cheated Ed Roberts, the founder of MITS and creator of the Altair. The Altair later had a disk operating system that was not CP/M, though many of them were used with it.
Gates should be put in jail as a habitual criminal. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
From what I can remember, they used the back slashes to avoid having problems with AT&T for copying Unix. I guess that they only worried about repercussions with items that were visible.
On Fri, 2007-12-07 at 14:25 +0000, Hans van der Merwe wrote:
On Fri, 2007-12-07 at 09:06 -0500, Felix Miata wrote:
On 2007/12/07 03:16 (GMT-0500) Aaron Kulkis apparently typed:
Randal Jarrett wrote:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders":
My Documents My Music My Pictures
Not to mention the horror of insisting on using the "wrong" slash as folder separator.
Hans ps. If I had a $ for every mail someone sent me to go and look at \\server\share name\file name
E-mail Disclaimer http://www.sunspace.co.za/emaildisclaimer.htm
-- Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Friday 2007-12-07 at 09:06 -0500, Felix Miata wrote:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders":
And you can have them in linux, too. No problem. Why should it be a problem? - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHWxMhtTMYHG2NR9URAl7bAJ9uqOkkmKQ8FKxhLFN5CdqxiwytdgCbB7S8 wHJA2u3qr8yY4sb8RfrkjV8= =gH7s -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
The Friday 2007-12-07 at 09:06 -0500, Felix Miata wrote:
A lot of the files and some of the directories have spaces in the name. ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders":
And you can have them in linux, too. No problem. Why should it be a problem?
Linux itself has no problem seeing and using directory and file names with spaces in them, but in general it's bad practice, because historically whitespace is a parsing token. Many tools behave badly with such situations since they expect a space to be a delimiter between arguments. Joe -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 08 December 2007 13:56, Carlos E. R. wrote:
The Friday 2007-12-07 at 09:06 -0500, Felix Miata wrote:
A lot of the files and some of the directories have spaces in the name.
^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
The M$ world has taught virtually everyone that spaces in filenames are no problem. Each M$ user has these "folders":
And you can have them in linux, too. No problem. Why should it be a problem?
As you say, they're not fundamentally a problem. In fact, Linux forbids only two characters from file names, slash ('/') and NUL. Windows has many more prohibited characters. But they are an annoyance, at a minimum, in command-line programming. Many scripts don't consider them and thus fail to quote variables that contain them when passing them as arguments to commands they invoke or as operands in other operations the script applies to those names. Then, when a name with spaces or other characters special to the shell is encountered, things go awry.
-- Cheers, Carlos E. R.
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Saturday 2007-12-08 at 14:19 -0800, Randall R Schulz wrote:
And you can have them in linux, too. No problem. Why should it be a problem?
As you say, they're not fundamentally a problem. In fact, Linux forbids only two characters from file names, slash ('/') and NUL. Windows has many more prohibited characters.
But they are an annoyance, at a minimum, in command-line programming. Many scripts don't consider them and thus fail to quote variables that contain them when passing them as arguments to commands they invoke or as operands in other operations the script applies to those names. Then, when a name with spaces or other characters special to the shell is encountered, things go awry.
As a user, I use them. As a programmer, when I write a script, I curse myself :-p - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHWzhAtTMYHG2NR9URAkOrAJ4t0b17LBd62T/yQbaakqsSWmz+/wCeJeOi hmVbEnHIy9FeO96zwU8FI8Q= =49R9 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 08 December 2007 16:35, Carlos E. R. wrote:
The Saturday 2007-12-08 at 14:19 -0800, Randall R Schulz wrote: [ regarding files whose names contain spaces and other special characters
As a user, I use them. As a programmer, when I write a script, I curse myself :-p
Well, I think we're far beyond the point where the parochial "Unix / Linux is all there is" mentality is tenable. So when writing shell scripts it really is incumbent upon the author of that script to accommodate arbitrary file names. It's not really difficult. At worst, it's a bit tedious, but after you do it for a while, it becomes second nature when you're in "scripting mode."
-- Cheers, Carlos E. R.
Randall Schulz -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Saturday 2007-12-08 at 14:19 -0800, Randall R Schulz wrote:
And you can have them in linux, too. No problem. Why should it be a problem?
As you say, they're not fundamentally a problem. In fact, Linux forbids only two characters from file names, slash ('/') and NUL. Windows has many more prohibited characters.
But they are an annoyance, at a minimum, in command-line programming. Many scripts don't consider them and thus fail to quote variables that contain them when passing them as arguments to commands they invoke or as operands in other operations the script applies to those names. Then, when a name with spaces or other characters special to the shell is encountered, things go awry.
As a user, I use them. As a programmer, when I write a script, I curse myself :-p
I just make namesLikeThis and names.like.that too easy, and saves OODLES of heartache. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I wish that I could wring some necks for that also. But since when did Micro$oft ever do anything logically? On Fri, 2007-12-07 at 03:16 -0500, Aaron Kulkis wrote:
Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
-- Randal Jarrett <rsj@radio.org> RSJ Consulting, Inc Hernando, FL (352) 419-0112 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Randal Jarrett wrote:
I wish that I could wring some necks for that also. But since when did Micro$oft ever do anything logically?
I firmly believe that Microsoft does some things just to make life as annoying and difficult for anyone who has to deal with non-Microsoft platforms... as some sort of punishment for using anything other than little PC's with their flaky hardware to get important work done. (Flaky as compared to the hardware you'll find in an IBM AS400 or P5's...and no, I'm *NOT* a fan of IBM. In the 1980's, I regarded them the same way I regard Microsoft now. My opinion of IBM didn't change until they hired their current CEO and he instituted new policies that amounted to more than "must... lock-in...customers"
On Fri, 2007-12-07 at 03:16 -0500, Aaron Kulkis wrote:
Randal Jarrett wrote:
I'm looking for either a utility or simple script (bash/perl) to convert text files from linux (lf) format to dos (cr/lf).
I need to move over 10k files and maintain the directory structure while doing it. A lot of the files and some of the directories have spaces in the name. I can process them on my system ^^^^^^^^^^^^^^^^^^^^^^^
What idiot did that?
and then move them to the win server. I also have to maintain the original files & structure.
Any and all assistance is appreciated.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
Randal Jarrett wrote:
I wish that I could wring some necks for that also. But since when did Micro$oft ever do anything logically?
I firmly believe that Microsoft does some things just to make life as annoying and difficult for anyone who has to deal with non-Microsoft platforms... Microsoft's tricks have been demonstrated in court many timessle .
-- Use OpenOffice.org <http://www.openoffice.org> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Aaron Kulkis wrote:
I wish that I could wring some necks for that also. But since when did Micro$oft ever do anything logically? I firmly believe that Microsoft does some things just to make
Randal Jarrett wrote: life as annoying and difficult for anyone who has to deal with non-Microsoft platforms... Microsoft's tricks have been demonstrated in court many timessle
Yes. And given the pattern of deliberate criminal behavior, I think the whole upper management should be indicted under the RICO (Racketeering Influenced and Corrupt Organizations) ACT. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Aaron Kulkis wrote:
James Knott wrote:
Aaron Kulkis wrote:
I wish that I could wring some necks for that also. But since when did Micro$oft ever do anything logically? I firmly believe that Microsoft does some things just to make
Randal Jarrett wrote: life as annoying and difficult for anyone who has to deal with non-Microsoft platforms... Microsoft's tricks have been demonstrated in court many timessle
Yes. And given the pattern of deliberate criminal behavior, I think the whole upper management should be indicted under the RICO (Racketeering Influenced and Corrupt Organizations) ACT.
This may not happen soon. http://www.campaignmoney.com/microsoft.asp -- Tony Alfrey tonyalfrey@earthlink.net "I'd Rather Be Sailing" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (15)
-
Aaron Kulkis
-
Billie Walsh
-
Bob S
-
Carlos E. R.
-
Felix Miata
-
G T Smith
-
Hans van der Merwe
-
James Knott
-
Joe Sloan
-
Otto Rodusek (AP-SGP)
-
Patrick Shanahan
-
Philipp Thomas
-
Randal Jarrett
-
Randall R Schulz
-
Tony Alfrey