[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-developers] Mac -> Unix file types
- Subject: Re: [cobalt-developers] Mac -> Unix file types
- From: "Byron C. Servies" <bservies@xxxxxxxxxx>
- Date: Sat Oct 21 08:25:02 2000
- List-id: Mailing list for developers on Cobalt Networks products <cobalt-developers.list.cobalt.com>
Hi,
If they're already on your raq/qube2, you might want to try:
$ perl -n -e 'tr/\r/\n; print $_;' FILE > NEWFILE
or, if there are a lot in a directory:
$ for i in *.html; do
> mv $i $i.orig
> perl -n -e 'tr/\r/\n; print $_;' $i.orig > $i
> done
Enclose $i in quotes if the file names have spaces in them. If you have a bunch
of a files in an directory tree:
$ find . -name '*.html' > MACFILES
$ for i in `cat MACFILES`; do
> mv $i $i.orig
> perl -n -e 'tr/\r/\n; print $_;' $i.orig > $i
> done
Also, most mac web developement programs will permit the user to transfer the
files to the server with unix line break semantics instead of mac-native
semantics.
Byron
On 10/21/00 at 3:28 PM, gerrit@xxxxxxxxxxxx (Gerrit Ruesing) wrote:
> >I'm processing some .html files that come off a Mac system, using sed to
> >fix things up, from a shell script.
> >
> >One glitch: I've found that I have to convert each file to unix format
> >(I have no idea of what the details here are) before sed will work
> >properly. I can do that by opening each file in TextPad and selecting
> >Unix file type in a pulldown of the Save-as function. There has to be a
> >better way.
> >
> >Do any of you happen to know a trick for mass-converting Mac text files
> >to Unix text files?
> >
>
> Hi,
>
> not a VERY good idea, but: use BBEdit Lite. There you can open
> several files at once.
> As far as I know the problem are the line delimiters. While unix
> is using only one of line feed&carriage return, DOS for example
> is using both. The Mac is even more confusing , at least for me ;-)
> I'm using a Mac here and I'm fine with using BBEdit 4.6 Lite (freeware)
> by choosing unix format firstly....
>
> If you find a better solution I would like to paticipate ..
> - Gerrit
>
> _______________________________________________
> cobalt-developers mailing list
> cobalt-developers@xxxxxxxxxxxxxxx
> http://list.cobalt.com/mailman/listinfo/cobalt-developers
>