Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!decwrl!decvax!tektronix!reed!kamath From: kamath@reed.UUCP (Sean Kamath) Newsgroups: comp.sys.apple Subject: Re: help for xmodem and text files (Actually UN*X twiddling) Keywords: xmodem text linefeeds Message-ID: <9475@reed.UUCP> Date: 7 Jun 88 18:07:14 GMT References: <3148@charon.unm.edu> Reply-To: kamath@reed.UUCP (Sean Kamath) Organization: Reed College, Portland OR Lines: 51 In article <3148@charon.unm.edu> cscbrkac@unmc.UUCP (Lazlo Nibble) writes: >If you're >having trouble with Apple <--> Unix textfile transfers, the following aliases I >use might come in handy: > >alias nl2cr "cat \!^ | tr '\012' '\015' > \!^.X ; rm -f \!^ ; mv \!^.X \!^" >alias cr2nl "cat \!^ | tr '\015' '\012' > \!^.X ; rm -f \!^ ; mv \!^.X \!^" [Actually, tr takes stding and send to stdout. tr ... out; mv -f out in does the smame thing] >Before you download a Unix file to your Apple, type "nl2cr " and after >you upload an Apple file to the Unix system type "cr2nl ". Takes care >of the incompatibilities between the Apple and Unix line delimiters. > >-- >Lazlo Nibble (cscbrkac@charon.unm.edu) Perhaps a little bit better method is to make a shell script to do that *and* download the file. Similarly for uploads. I ended up with fours files (which I guess would very easily be sent into one with a flag), two for uploads, two for downs (One is DOS 3.3, the other ProDOS.). ex: #!/bin/sh mkdir /tmp/tmp.$$ for i in $* do tr '\012' '\015' < $i > /tmp/tmp.$$/$i.up done #either x or y modem works here ymodem -flags `/bin/ls /tmp/tmp.$$` rm -f /tmp/tmp.$$ exit 0 Of course, more is needed if you want to do a series of xmodems. The point is, that in mangling files, it's much better to make the modifications somewhere else, to *something* else. This way, the modificatons don't muck around with the originals, and you don't have to remember to do them separately. Sean Kamath (Sorry for all you VMS-types. . .Though I'm sure you could so something similar.) -- UUCP: {decvax allegra ucbcad ucbvax hplabs ihnp4}!tektronix!reed!kamath CSNET: reed!kamath@Tektronix.CSNET || BITNET: reed!kamath@PSUVAX1.BITNET ARPA: reed!kamath@PSUVAX1.CS.PSU.EDU US Snail: 3934 SE Boise, Portland, OR 97202-3126 (I hate 4 line .sigs!)