Re: tr problem
On Tuesday 17 June 2008, Tim wrote: On Tue, 2008-06-17 at 12:12 -0400, Carroll Grigsby wrote: If and when you try that little experiment, be very careful when you heat up the metal block -- the metal is a lead alloy and has a rather low melting point. I know. ;-) The tour we had was quite comprehensive, including how they made and recycled them. All in all, it's quite an amazing process for what they used to go through to make just one page. If I remember correctly, and this would be going back some 26 years or so, it seemed like a cross between lead and aluminium. They don't alloy Tim, its lead, tin, and antimony. -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) Lemmings don't grow older, they just die. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Monday 16 June 2008 11:44:59 pm Tim wrote: Tim: (about cut and paste) I always thought that term came from designing newspaper page layouts. Craig White: probably more accurate to say offset printing which allowed you to create plates from a camera so you could do paste-ups on cardboard. Fair enough. I can remember going for a tour through our newspaper building when they still worked that way. We were led through the whole production process, in order. Somewhere I still have my name on a metal block - one of the linotypers bashed out all our names for us, and I kept mine. I wish I could find it, I could use it for neatly naming my plastic possessions with a bit of applied heat. ;-) -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Tim: If and when you try that little experiment, be very careful when you heat up the metal block -- the metal is a lead alloy and has a rather low melting point. -- cmg -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Tue, 2008-06-17 at 12:12 -0400, Carroll Grigsby wrote: If and when you try that little experiment, be very careful when you heat up the metal block -- the metal is a lead alloy and has a rather low melting point. I know. ;-) The tour we had was quite comprehensive, including how they made and recycled them. All in all, it's quite an amazing process for what they used to go through to make just one page. If I remember correctly, and this would be going back some 26 years or so, it seemed like a cross between lead and aluminium. -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sun, 2008-06-15 at 12:02 +0100, Anne Wilson wrote: On Sunday 15 June 2008 10:59:22 Tim wrote: There's quite a bit of skill in hand typing something without any errors. There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Actually, this is where the expression cut-and-paste originates :-) poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Monday 16 June 2008 13:12:59 Patrick O'Callaghan wrote: On Sun, 2008-06-15 at 12:02 +0100, Anne Wilson wrote: On Sunday 15 June 2008 10:59:22 Tim wrote: There's quite a bit of skill in hand typing something without any errors. There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Actually, this is where the expression cut-and-paste originates :-) Typewriters didn't have memory when I started :-) You wouldn't believe some of the machines I worked with. They looked like something out of a 1930s film. London office got new typewriters and the existing ones rippled down the pecking order. Anything left at the end came to Batley, and I was at the bottom of the pecking order there, too :-) Anne signature.asc Description: This is a digitally signed message part. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Anne Wilson: There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Patrick O'Callaghan: Actually, this is where the expression cut-and-paste originates :-) I always thought that term came from designing newspaper page layouts. -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Mon, 2008-06-16 at 23:09 +0930, Tim wrote: Anne Wilson: There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Patrick O'Callaghan: Actually, this is where the expression cut-and-paste originates :-) I always thought that term came from designing newspaper page layouts. probably more accurate to say offset printing which allowed you to create plates from a camera so you could do paste-ups on cardboard. Craig -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Mon, 2008-06-16 at 23:09 +0930, Tim wrote: Anne Wilson: There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Patrick O'Callaghan: Actually, this is where the expression cut-and-paste originates :-) I always thought that term came from designing newspaper page layouts. According to Wikipedia (source of all knowledge and wisdom): The term cut and paste derives from the traditional practice in manuscript-editing whereby people would literally cut paragraphs from a page with scissors and physically paste them onto another page. This practice remained standard as late as the 1960s. Stationery stores formerly sold editing scissors with blades long enough to cut an 8-1/2-wide page. The advent of photocopiers made the practice easier and more flexible. More to the point, I remember actually doing this ... See http://en.wikipedia.org/wiki/Cut-and-paste poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Tim: (about cut and paste) I always thought that term came from designing newspaper page layouts. Craig White: probably more accurate to say offset printing which allowed you to create plates from a camera so you could do paste-ups on cardboard. Fair enough. I can remember going for a tour through our newspaper building when they still worked that way. We were led through the whole production process, in order. Somewhere I still have my name on a metal block - one of the linotypers bashed out all our names for us, and I kept mine. I wish I could find it, I could use it for neatly naming my plastic possessions with a bit of applied heat. ;-) -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sun, 2008-06-15 at 00:19 -0400, Gene Heskett wrote: On Saturday 14 June 2008, Ric Moore wrote: Whoops! You ferget the NEC Spinwriter at 50 cps! It was smart and tabbed over spaces to do it. Diablo's (I've had several) needed software drivers to do the same thing. I wish I still had mine. sighs Ric Ahh Ric, but the Spinwriter was not IIRC a real daisy, it was more like an overgrown thimble that IIRC had more then one char per leaf, so it moved in 2 directions to put the right character under the hammer. It spun, and moved up and down but it didn't have to move near as far as the daisy wheel did to put the right char under the hammer. Diablo's by now, have a platen roller that is as hard as glass, this in spite of, or perhaps because of, repeated applications of rubber renu, so their much vaunted quality of the finished product hasn't been like new in 30 years. I used rubbing alcohol liberally to soften it up. But I still own it till the next time it gets in my way out in the storage shed. Then it goes onto a 2 wheeler, and to the curb. It was nice, very nice, for as long as it lasted, about 15 years of fairly steady use here. I probably ran 30 cartons of std tractor feed through it myself. Remember when you could by a carton of paper for $15? Ribbons for $4? Now my damn printer uses 25 cents worth of ink when you turn it on and it prints a damn test page. I miss the look of a good carbon ribbon's output, too. It looked raised and very professional. Ah, they were gentler times. I could type on the 5525 SpinWriter's keyboard and through the full duplex serial connection to my Apple][, I got lower case!! Ha! Ric -- My father, Victor Moore (Vic) used to say: There are two Great Sins in the world... ..the Sin of Ignorance, and the Sin of Stupidity. Only the former may be overcome. R.I.P. Dad. Linux user# 44256 Sign up at: http://counter.li.org/ http://www.sourceforge.net/projects/oar https://oar.dev.java.net/ Verizon Cell # 336-254-1339 - -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sun, 2008-06-15 at 02:36 -0400, Ric Moore wrote: Remember when you could by a carton of paper for $15? Ribbons for $4? Now my damn printer uses 25 cents worth of ink when you turn it on and it prints a damn test page. Boxes of 2000 fan-fold sheets that lasted ages, and because you're not putting sheets into a tiny hopper, you weren't forever adding paper to a printer every other day. Likewise with ribbons that lasted for years. I gave up on inkjet printers, long ago. The running costs are stupid, the disable products an environmental disaster, made all the more worse by their short lifespan. I miss the look of a good carbon ribbon's output, too. It looked raised and very professional. I'm very impressed if, these days, I receive something that's obviously hand typed. There's quite a bit of skill in hand typing something without any errors. -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sunday 15 June 2008 10:59:22 Tim wrote: There's quite a bit of skill in hand typing something without any errors. There's a lot of skill. I remember all too well getting to the end of a long document, only to find a typo. The only resort was to rip it out and start again. Believe me, I do not mourn the old days. Neither would you if you had to pay me for the time to type it two or three times for a simple correction. Anne signature.asc Description: This is a digitally signed message part. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sun, 2008-06-15 at 19:29 +0930, Tim wrote: Boxes of 2000 fan-fold sheets that lasted ages, and because you're not putting sheets into a tiny hopper, you weren't forever adding paper to a printer every other day. Likewise with ribbons that lasted for years. Those were the days. I typed my PhD thesis in 'em', formatted it with 'nroff' and printed it on a Diablo. The figures were hand-drawn using a stencil set. These young whippersnappers don't know what computing is all about :-) (Cue Monty Python's Four Yorkshiremen sketch) poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Gene Heskett wrote: CoCo's have always had lowercase, just didn't show it. I'm logged into mine with minicom right now. :-) Working on mouse drivers, somebodies update broke them. Aren't there emulators these days so you don't have to deal with serial cables for your nostalgia? -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On 06/15/2008 11:04:07 AM, Patrick O'Callaghan wrote: On Sun, 2008-06-15 at 19:29 +0930, Tim wrote: Boxes of 2000 fan-fold sheets that lasted ages, and because you're not putting sheets into a tiny hopper, you weren't forever adding paper to a printer every other day. Likewise with ribbons that lasted for years. Those were the days. I typed my PhD thesis in 'em', formatted it with 'nroff' and printed it on a Diablo. The figures were hand-drawn using a stencil set. These young whippersnappers don't know what computing is all about :-) Not familiar with 'em', I was stuck on using 'SOS' on an overloaded PDP-10. It might not have been the same 'nroff' but the name was the same. I was at least subsidized to use the Calcomp drum plotter. OTOH, getting that Diablo to print that whole thing out was _painful_ and loud. And required working in the wee hours of the morning as the system was marginally less overloaded then. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sun, 2008-06-15 at 14:10 -0400, Thompson Freeman wrote: Not familiar with 'em', I was stuck on using 'SOS' on an overloaded PDP-10. It might not have been the same 'nroff' but the name was the same. I was at least subsidized to use the Calcomp drum plotter. 'em' (Editor for Mortals) was an extended version of 'ed' written by George Coulouris at Queen Mary College, London. It had in-line interactive editing! (just one line at a time, mind, no sense going overboard). As using 'ed' has been compared to playing blindfold chess, this was quite an advance for the mid-70's. George actually came up to Edinburgh and installed it on our PDP 11/45 from a paper tape! IIRC, the folklore has it that 'em' gave Bill Joy some ideas which he used in 'ex' and then in 'vi'. BTW I also suffered under SOS, and TECO. The horror, the horror ... poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sunday 15 June 2008, Les Mikesell wrote: Gene Heskett wrote: CoCo's have always had lowercase, just didn't show it. I'm logged into mine with minicom right now. :-) Working on mouse drivers, somebodies update broke them. Aren't there emulators these days so you don't have to deal with serial cables for your nostalgia? That is the whole point Les, its the real deal, not some emu thing. -- Les Mikesell [EMAIL PROTECTED] -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) Of all forms of caution, caution in love is the most fatal. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sat, 2008-06-14 at 19:24 +1000, Cameron Simpson wrote: A line _should_ be terminated by a single character. What that character is is a somewhat arbitrary choice, given that the ASCII table doesn't have an end-of-line (EOL) character, just CR and LF and ASCII was what was there the play with. UNIX went with NL, OS/9 and Macs went with CR, and DOS went with I'm too dumb to translate text delimiters into printer control actions, thus its CR/NL overspeak. Considering that the display of text files is still done over terminals where the ability to return to the beginning of the same line and overwrite, is a useful feature, there's value in the end of line having separate line feed and return characters. Not all display of text is of static text. -- [EMAIL PROTECTED] ~]$ uname -r 2.6.25.6-55.fc9.i686 Don't send private replies to my address, the mailbox is ignored. I read messages from the public lists. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On 14Jun2008 20:38, Tim [EMAIL PROTECTED] wrote: | On Sat, 2008-06-14 at 19:24 +1000, Cameron Simpson wrote: | A line _should_ be terminated by a single character. What that character | is is a somewhat arbitrary choice, given that the ASCII table doesn't | have an end-of-line (EOL) character, just CR and LF and ASCII was what | was there the play with. UNIX went with NL, OS/9 and Macs went with CR, | and DOS went with I'm too dumb to translate text delimiters into | printer control actions, thus its CR/NL overspeak. | | Considering that the display of text files is still done over terminals | where the ability to return to the beginning of the same line and | overwrite, is a useful feature, there's value in the end of line having | separate line feed and return characters. Not all display of text is of | static text. Sure, but these are still terminal control actions, and irrelevant the the data storage. There's value in being able to control the terminal that way, but not in ending the text line with a pair of terminal control actions instead of a single character delimiter. We're talking about static text storage here, not terminal or printer manipulation. -- Cameron Simpson [EMAIL PROTECTED] DoD#743 http://www.cskk.ezoshosting.com/cs/ Imagine that CRAY decides to make a personal computer. It contains 16 Alpha based processors executing in parallel, has 800 megabytes of RAM, 100 Gigabytes of disk storage, a resolution of 4096 x 4096 pixels, does 24bit 3D graphics in realtime, relies entirely on voice recognition for input, fits in your shirt pocket and costs $300. What is the first question the computer community asks? Is it DOS compatible? -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Saturday 14 June 2008, Cameron Simpson wrote: On 13Jun2008 22:42, Gene Heskett [EMAIL PROTECTED] wrote: | Before this gets too far off the track, I wanted to replace the single $0D | with a single $0A. And yes, I'm aware that dos used both characters, | which I hate to admit is the actual right way to do it. You're right to hate it, because it is the wrong way to do it. Using two characters as a line delimiter is mad, because it introduces parsing ambiguity (what should a bare \r or \n mean? What about \n\r? etc). The two character delimiter is a holdover from naively coded systems that wanted to dump text files direct to printers without any translation, so a carriage return and a line feed were needed to manipulate the printer head. Which is just daft in a data storage format. That the IETF internet text protocols use CR+NL as line delimiters is a compatibility thing, not a recommendation. A line _should_ be terminated by a single character. What that character is is a somewhat arbitrary choice, given that the ASCII table doesn't have an end-of-line (EOL) character, just CR and LF and ASCII was what was there the play with. UNIX went with NL, OS/9 and Macs went with CR, and DOS went with I'm too dumb to translate text delimiters into printer control actions, thus its CR/NL overspeak. Maybe, but back then there was a lot of attempted lockin to store branded printers by selling the one that talked to the computers they were selling with a minimum of hassle making it difficult to reconfigure them to your machine of choice. Radio shack was extremely guilty of that. Getting OT for a bit.. I have an old Xerox Diablo 1650-ro printer, the fastest daisy wheel ever made at 40 cps. It also didn't have any jumpers to tell it to do a line feed, it did what you told it literally at an input speed of 1200 baud. In this case it was easy enough for the printer driver to add the linefeed with an option setting in the devices descriptor file. Woe be to the person who sat one of those on a std printer stand of the day without adding a sheet of 1/4 plywood across the back screwed in place, nails would fall out. If not reinforced against the hip check the stand took every time the head did a cr, it would all be on the floor in less than a box of tractor feed. A great printer in its day, but today the film ribbons are so brittle with old age they are broken on the first character strike. I can buy a fresh Brother Laser at Staples for less than a case of ribbons for for the Xerox, so I did. I now pipe that machines text only output to this one at 9600 baud, run it through cups which doesn't seem to care about the EOL char used, and send it back to the Brother sitting on that machines desk, all thanks to usb extension cables and ser-usb adapters. And its 20 some PPM out of the Brother. Whats not to like? Cheers, -- Cameron Simpson [EMAIL PROTECTED] DoD#743 http://www.cskk.ezoshosting.com/cs/ Microsoft: Where do you want to go today? UNIX: Been there, done that! -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) It's only by NOT taking the human race seriously that I retain what fragments of my once considerable mental powers I still possess. -- Roger Noe -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sat, 2008-06-14 at 09:05 -0700, Les wrote: [...] And while I dislike the issues with text presentation that occur, I do understand the history of it, and the issue of backward compatibility. You might find it entertaining to look up some of the history of text editors some time, and certainly informative. Well, I installed my first Unix system in 1975 so I do know something about that. And I clearly remember finding out about the Unix convention of a single-character end-of-line marker and think thank God, at last someone has done this right. It's noteworthy that this was way before MS-DOS came along and screwed it up again. [...] Perhaps with your great insight you might provide the Second Life, VRML, Croquet, Cobalt, WOW, and others with valuable information on standardization? How did you get from representing text on some device to weak sarcasm about all that other stuff? Strawman arguments don't change one iota of what I'm saying, i.e. that plain text is plain text, and displaying is displaying. The context of this discussion is the conversion of a plain text file from one system to another, that's all. poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sat, 2008-06-14 at 10:20 -0400, Gene Heskett wrote: I have an old Xerox Diablo 1650-ro printer, the fastest daisy wheel ever made at 40 cps. Whoops! You ferget the NEC Spinwriter at 50 cps! It was smart and tabbed over spaces to do it. Diablo's (I've had several) needed software drivers to do the same thing. I wish I still had mine. sighs Ric -- My father, Victor Moore (Vic) used to say: There are two Great Sins in the world... ..the Sin of Ignorance, and the Sin of Stupidity. Only the former may be overcome. R.I.P. Dad. Linux user# 44256 Sign up at: http://counter.li.org/ http://www.sourceforge.net/projects/oar https://oar.dev.java.net/ Verizon Cell # 336-254-1339 - -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Sat, 2008-06-14 at 22:14 -0400, Ric Moore wrote: On Sat, 2008-06-14 at 12:00 -0430, Patrick O'Callaghan wrote: On Sat, 2008-06-14 at 09:05 -0700, Les wrote: [...] And while I dislike the issues with text presentation that occur, I do understand the history of it, and the issue of backward compatibility. You might find it entertaining to look up some of the history of text editors some time, and certainly informative. Well, I installed my first Unix system in 1975 so I do know something about that. And I clearly remember finding out about the Unix convention of a single-character end-of-line marker and think thank God, at last someone has done this right. It's noteworthy that this was way before MS-DOS came along and screwed it up again. [...] Perhaps with your great insight you might provide the Second Life, VRML, Croquet, Cobalt, WOW, and others with valuable information on standardization? How did you get from representing text on some device to weak sarcasm about all that other stuff? Strawman arguments don't change one iota of what I'm saying, i.e. that plain text is plain text, and displaying is displaying. The context of this discussion is the conversion of a plain text file from one system to another, that's all. His point was, Poc, that a simple avatar cannot move between current 3D systems today much like the end-of-line char debate that has raged for over 30 years. (You forgot Wonderland, Les! That's the one I'm betting the farm on.) Knowing Les, I think his point was that the rightness/wrongness debate over the EOL char is as futile then as the avatar problem is now. The situation sucks, but there it is. No one listens much to us anyway, so we get to keep the pieces. chuckles Ric That part I do believe :-) poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Fri, 13 Jun 2008 10:19:16 +1000 Cameron Simpson wrote: That's because \ is a shell quoting character. You need to quote it:-) tr -c '\r' '\n' filename filename2 Then tr will see the \ character. So that with: tr -c \\r \\n filename filename2 I won by two characters ... ;-) Gianluca -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Gene Heskett wrote: Man pages generally never mention the things the shell does to a command line before starting the program. This will include expanding variables and wildcard filenames, redirecting I/O, and other things triggered by shell metacharacters. In this case tr doesn't particularly need the quotes, but if you don't use them the shell will parse and remove the \ characters (treating them as quotes for the following character in its own parsing). These details are the same for every command you type (or script) and not repeated in every man page. I got it working now, but once its done, I won't need it again till 3 years down the log, and will have forgotten it again. Thanks Les. But you use the shell every day and it parses/processes every command you type. It's worth a bit of time learning what to expect from it at least in terms of variable and wildcard substitions, i/o redirection, quote processing and a few other things. And it helps to know that when looking at any other program's man page. -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Thu, 2008-06-12 at 23:46 -0400, Gene Heskett wrote: On Thursday 12 June 2008, Les Mikesell wrote: Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? The tr syntax would be tr -d '\r' but for one or a few files you can just load in vi (vim) and :set fileformat=unix And that might be something that is not in the vim manpages Mike, thanks. and write it back out. Plus, you probably have a program called dos2unix installed... os uses and end of line characterws That is the other option with my CRS, I couldn't remember that name with a $1000 bill being offered. I'm seemingly being reminded that memory is the second thing to go. :) Except as stated by the OP your solution of dos2unix might not work, DOS uses as eol characters cr followed by lf. So you would not want in that case to replace a cr by a lf. You would want to just remove the cr. In vi this is done by the command: :.,$s/^V^M// -- === Westheimer's Discovery: A couple of months in the laboratory can frequently save a couple of hours in the library. === Aaron Konstam telephone: (210) 656-0355 e-mail: [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Fri, 2008-06-13 at 09:29 +0200, Gianluca Cecchi wrote: On Fri, 13 Jun 2008 10:19:16 +1000 Cameron Simpson wrote: That's because \ is a shell quoting character. You need to quote it:-) tr -c '\r' '\n' filename filename2 Then tr will see the \ character. So that with: tr -c \\r \\n filename filename2 I won by two characters ... ;-) Eliminating the '-c' will give three characters less and will actually work. poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Fri, 2008-06-13 at 16:42 +0200, Michael Schwendt wrote: On Fri, 13 Jun 2008 09:31:19 -0500, Aaron Konstam wrote: Except as stated by the OP your solution of dos2unix might not work, DOS uses as eol characters cr followed by lf. So you would not want in that case to replace a cr by a lf. You would want to just remove the cr. In vi this is done by the command: :.,$s/^V^M// $ rpm -qf /usr/bin/mac2unix dos2unix-3.1-31.fc9.i386 ;o) How is this a response to what I said? -- === Many people resent being treated like the person they really are. === Aaron Konstam telephone: (210) 656-0355 e-mail: [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Fri, 13 Jun 2008 15:41:31 -0500, Aaron Konstam wrote: On Fri, 2008-06-13 at 16:42 +0200, Michael Schwendt wrote: On Fri, 13 Jun 2008 09:31:19 -0500, Aaron Konstam wrote: Except as stated by the OP your solution of dos2unix might not work, DOS uses as eol characters cr followed by lf. So you would not want in that case to replace a cr by a lf. You would want to just remove the cr. In vi this is done by the command: :.,$s/^V^M// $ rpm -qf /usr/bin/mac2unix dos2unix-3.1-31.fc9.i386 ;o) How is this a response to what I said? mac2unix is just dos2unix -c Mac and can be used to replace CR line delimiters with LF, which is what Gene, the OP, wants. On the contrary, where the line delimiters are CR+LF (DOS, Windows), dos2unix can be used. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Fri, 2008-06-13 at 23:52 +0200, Michael Schwendt wrote: On Fri, 13 Jun 2008 15:41:31 -0500, Aaron Konstam wrote: On Fri, 2008-06-13 at 16:42 +0200, Michael Schwendt wrote: On Fri, 13 Jun 2008 09:31:19 -0500, Aaron Konstam wrote: Except as stated by the OP your solution of dos2unix might not work, DOS uses as eol characters cr followed by lf. So you would not want in that case to replace a cr by a lf. You would want to just remove the cr. In vi this is done by the command: :.,$s/^V^M// $ rpm -qf /usr/bin/mac2unix dos2unix-3.1-31.fc9.i386 ;o) How is this a response to what I said? mac2unix is just dos2unix -c Mac and can be used to replace CR line delimiters with LF, which is what Gene, the OP, wants. On the contrary, where the line delimiters are CR+LF (DOS, Windows), dos2unix can be used. Or 'tr -d \015 input output' I got so used to typing that that I couldn't be bothered even making an alias for it. poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Friday 13 June 2008, Aaron Konstam wrote: On Thu, 2008-06-12 at 23:46 -0400, Gene Heskett wrote: On Thursday 12 June 2008, Les Mikesell wrote: Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? The tr syntax would be tr -d '\r' but for one or a few files you can just load in vi (vim) and :set fileformat=unix And that might be something that is not in the vim manpages Mike, thanks. and write it back out. Plus, you probably have a program called dos2unix installed... os uses and end of line characterws That is the other option with my CRS, I couldn't remember that name with a $1000 bill being offered. I'm seemingly being reminded that memory is the second thing to go. :) Except as stated by the OP your solution of dos2unix might not work, DOS uses as eol characters cr followed by lf. So you would not want in that case to replace a cr by a lf. You would want to just remove the cr. In vi this is done by the command: :.,$s/^V^M// Before this gets too far off the track, I wanted to replace the single $0D with a single $0A. And yes, I'm aware that dos used both characters, which I hate to admit is the actual right way to do it. -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) College: The fountains of knowledge, where everyone goes to drink. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
tr problem
Hi folks; I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? Thanks. -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) I'm really enjoying not talking to you ... Let's not talk again REAL soon ... -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? The tr syntax would be tr -d '\r' but for one or a few files you can just load in vi (vim) and :set fileformat=unix and write it back out. Plus, you probably have a program called dos2unix installed... -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Gene Heskett wrote: Hi folks; I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? Thanks. When the man page says that the -c option causes tr to first complement SET1, another way to say it is that using -c will cause a matche to everything but SET1. The reason file I/O in not covered is that tr is normally a filter, so you would use in a pipe between two other programs. It takes what comes in from stdin, does its thing, and sends it to stdout. This is common among filter programs. Another thing common among filter programs is that they will not have any opening message, and will send errors to stderr. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Les Mikesell wrote: Les Mikesell wrote: Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? The tr syntax would be tr -d '\r' but for one or a few files you can just load in vi (vim) and :set fileformat=unix and write it back out. Plus, you probably have a program called dos2unix installed... Oops, I should have read past the word 'legacy' which must not have meant what I thought. tr '\r' '\n' should work. More like: cat input-filename | tr '\r' '\n' output-filename Not so? tr is a filter. -- - Rick Stevens, Systems Engineer [EMAIL PROTECTED] - - Hosting Consulting, Inc. - -- - I never drink water because of the disgusting things that fish do - - in it.- - -- WC. Fields - -- -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Rick Stevens wrote: The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. Plus, you probably have a program called dos2unix installed... Oops, I should have read past the word 'legacy' which must not have meant what I thought. tr '\r' '\n' should work. More like: cat input-filename | tr '\r' '\n' output-filename Not so? tr is a filter. It reads stdin and writes stdout, like most unix command line programs. The shell will connect those to whatever you want with |'s or 's. Using cat with a pipe is a waste of a process, though. tr can read it's own input just as well with input-filename. -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On 12Jun2008 16:35, Gene Heskett [EMAIL PROTECTED] wrote: | I'm trying to convert a test file, src code for a legacy computer, whose eol is | a single cr into one with a newline subbed for each cr, and tr is being a pita, | it broken, or there is PEBKAC. | | If I use this syntax: | | tr -c \r \n filename filename2 | | Then the whole file is converted to nn's, every byte. That's because \ is a shell quoting character. You need to quote it:-) tr -c '\r' '\n' filename filename2 Then tr will see the \ character. | The manpage (and pinfo tr too) is, shall we say, completely lacking in how to | handle the file I/O. As Les has mentioned, tr is a filter (like almost every UNIX command in its bare form), so what you wrote is exactly right, except for the quotes. | Or is there a better tool for this than tr? No, tr is the best thing for this particular purpose. Cheers, -- Cameron Simpson [EMAIL PROTECTED] DoD#743 http://www.cskk.ezoshosting.com/cs/ So the master hit the novice upside the head with the back of his hand. Why did you do that!? I do not want to have to learn another editor. And the student was enlightened.- Larry Colen [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On 12Jun2008 19:47, Patrick O'Callaghan [EMAIL PROTECTED] wrote: | On Thu, 2008-06-12 at 18:53 -0500, Les Mikesell wrote: | It reads stdin and writes stdout, like most unix command line programs. |The shell will connect those to whatever you want with |'s or | 's. Using cat with a pipe is a waste of a process, though. tr can | read it's own input just as well with input-filename. | | Quite true, but I remember a remark in one of the classic Unix papers to | the effect that people somehow found the 'cat foo | ' syntax more | natural. There's plenty of stuff that's more natural that shouldn't be done. I'd start with snoring and progress from there... -- Cameron Simpson [EMAIL PROTECTED] DoD#743 http://www.cskk.ezoshosting.com/cs/ It's hard to believe that something as rational as the metric system was invented by the French. - Henry O. Farad [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Patrick O'Callaghan wrote: The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. Plus, you probably have a program called dos2unix installed... Oops, I should have read past the word 'legacy' which must not have meant what I thought. tr '\r' '\n' should work. More like: cat input-filename | tr '\r' '\n' output-filename Not so? tr is a filter. It reads stdin and writes stdout, like most unix command line programs. The shell will connect those to whatever you want with |'s or 's. Using cat with a pipe is a waste of a process, though. tr can read it's own input just as well with input-filename. Quite true, but I remember a remark in one of the classic Unix papers to the effect that people somehow found the 'cat foo | ' syntax more natural. I suppose you get used to using cat when there are multiple input files that you want to combine. -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Thursday 12 June 2008, Les Mikesell wrote: Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Or is there a better tool for this than tr? The tr syntax would be tr -d '\r' but for one or a few files you can just load in vi (vim) and :set fileformat=unix And that might be something that is not in the vim manpages Mike, thanks. and write it back out. Plus, you probably have a program called dos2unix installed... That is the other option with my CRS, I couldn't remember that name with a $1000 bill being offered. I'm seemingly being reminded that memory is the second thing to go. :) -- Les Mikesell [EMAIL PROTECTED] -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) Hello? Enema Bondage? I'm calling because I want to be happy, I guess ... -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Thu June 12 2008 20:42:51 Gene Heskett wrote: On Thursday 12 June 2008, Michael Schwendt wrote: Why option -c? Cuz the manpage says that it triggers the character convert thing? My manpage says -c is for complementing the first set. Could you please show us the relevant excerpt from your buggy manpage? --Mike Bird -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
On Thursday 12 June 2008, Mike Bird wrote: On Thu June 12 2008 20:42:51 Gene Heskett wrote: On Thursday 12 June 2008, Michael Schwendt wrote: Why option -c? Cuz the manpage says that it triggers the character convert thing? My manpage says -c is for complementing the first set. Could you please show us the relevant excerpt from your buggy manpage? --Mike Bird PEBKAC, Mike. Can't read plain english it would appear. Memory, 2nd thing to go... -- Cheers, Gene There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. -Ed Howdershelt (Author) Irrationality is the square root of all evil -- Douglas Hofstadter -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Re: tr problem
Gene Heskett wrote: I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. If I use this syntax: tr -c \r \n filename filename2 Then the whole file is converted to nn's, every byte. The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O. So how do you use tr? Why option -c? tr '\r' '\n' filename filename2 would do it. Cuz the manpage says that it triggers the character convert thing? No, tr actually takes 2 'sets' of characters even though in your use you only need one character in each set. For example tr '[A-Z]' '[a-z]' would lowercase a file (and the brackets and quotes aren't strictly necessary but would be on a sysV version). The -c option means to complement the first set (i.e. it becomes the characters not included). It doesn't touch on its performance if the option isn't given. And it doesn't mention using the quotes either, but it worked just fine, thank you very much. Man pages generally never mention the things the shell does to a command line before starting the program. This will include expanding variables and wildcard filenames, redirecting I/O, and other things triggered by shell metacharacters. In this case tr doesn't particularly need the quotes, but if you don't use them the shell will parse and remove the \ characters (treating them as quotes for the following character in its own parsing). These details are the same for every command you type (or script) and not repeated in every man page. -- Les Mikesell [EMAIL PROTECTED] -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list