r//d"
Because using 'env' doesn't preserve switches.
Personally, I use a tcsh alias:
% which dos2unix
dos2unix:aliased to perl -pi -e "tr/\r//d"
But Chris' script could become:
#!/usr/bin/perl -pi
tr/\r//d
which would save one level of processes but no longer search the $PATH.
-Ken
y trying to save you a line. :-)
Yeah, but it doesn't really matter how complex the script is, so long as
you can just do a
$ dos2unix file.txt
and get back a clean result.
If I was going to make any modifications to the file, rather than
simplify it, I'd force it to quit ra
On Jul 8, 2005, at 9:26 PM, Chris Devers wrote:
#!/bin/sh
perl -pi -e "tr/\r//d"
Hi Chris,
I tried to call perl directly. But this does not work
at all. Does anyone know why?
#!/usr/bin/env perl -pi -e "tr/\r//d"
See, I was only trying to save you a line. :-)
Joe.
On Fri, 8 Jul 2005, Lola Lee wrote:
In the Makefile.PL is a workaround for Unix-like systems (using cat
and dos2unix). Does MacOS come with cat and dos2unix "command-line"
utilities? If so, what are they called? And what is the value of $^O?
(darwin I think?)
Does this guy lite
are seeing are actually caused by a bug in Pod::Parser
(I reported it to the author LONG time ago but no reply). You can
install the distro and use it just fine despite these errors.
In the Makefile.PL is a workaround for Unix-like systems (using cat
and dos2unix). Does MacOS come with cat an
uthor LONG time ago but no reply). You can
install the distro and use it just fine despite these errors.
In the Makefile.PL is a workaround for Unix-like systems (using cat
and dos2unix). Does MacOS come with cat and dos2unix "command-line"
utilities? If so, what are they called? And
Bruce Van Allen wrote:
> At 1:23 PM -0500 2002-10-07, Puneet Kishor wrote:
>
>> Bruce Van Allen wrote:
>>
>>> At 1:01 PM -0500 2002-10-07, Puneet Kishor wrote:
>>>
s/ +/ /g;
seems to work just as well. Which begs the question... why even have
\s? maybe because tmtowtdi?!
>
At 1:23 PM -0500 2002-10-07, Puneet Kishor wrote:
>Bruce Van Allen wrote:
>> At 1:01 PM -0500 2002-10-07, Puneet Kishor wrote:
>>
>>> s/ +/ /g;
>>>
>>> seems to work just as well. Which begs the question... why even have
>>> \s? maybe because tmtowtdi?!
>>>
>> \s stands for "white space": [ \
Bruce Van Allen wrote:
> At 1:01 PM -0500 2002-10-07, Puneet Kishor wrote:
>
>> s/ +/ /g;
>>
>> seems to work just as well. Which begs the question... why even have
>> \s? maybe because tmtowtdi?!
>>
>
> \s stands for "white space": [ \t\n\r\f].
yes, I know that ;-)
which is why I am asking wh
At 1:01 PM -0500 2002-10-07, Puneet Kishor wrote:
>s/ +/ /g;
>
>seems to work just as well. Which begs the question... why even have
>\s? maybe because tmtowtdi?!
>
\s stands for "white space": [ \t\n\r\f].
HTH
1;
--
- Bruce
__bruce_van_allen__santa_cruz_ca__
John Delacour wrote:
> At 5:46 pm +0200 6/10/02, Adriano Allora wrote:
>
>> When I use it in a regexp (s/\s+/\s/g;)(I want it works to singularize
>> all the multi-whitespaces), the Terminal tells me:
>> Unrecognized escape \s passed through at cleaner line 27.
>
>
> \s means ANY white space c
At 5:46 PM +0200 10/6/02, Adriano Allora wrote:
>Now I have another problem: the 5.6 version perl on jaguar doesn't accept
>the escape character \s, does it?
>When I use it in a regexp (s/\s+/\s/g;)(I want it works to singularize
>all the multi-whitespaces), the Terminal tells me:
>Unrecognized es
At 7:54 pm +0200 30/9/02, Adriano Allora wrote:
>On the one hand I didn't express myself very well, but for the other
>hand I found other aspects of the problem.
>
>Actual situation: I work with mac osx.2, vi editor, a pack of dos
>files to work on.
>When I open my files with vi I see some string
At 5:46 pm +0200 6/10/02, Adriano Allora wrote:
>When I use it in a regexp (s/\s+/\s/g;)(I want it works to
>singularize all the multi-whitespaces), the Terminal tells me:
>Unrecognized escape \s passed through at cleaner line 27.
\s means ANY white space character, so in your substitution patt
Hi to all,
and thank you for the solutions you adviced me about the dos2unix
problem (when I saw with the cat command that nvi doesn't change the
content files I decided to substitute all the line endings with \n and
stop there).
Now I have another problem: the 5.6 version perl on j
At 7:54 PM +0200 9/30/2002, Adriano Allora wrote:
>On the one hand I didn't express myself very well, but for the other hand I found
>other aspects of the problem.
>
>Actual situation: I work with mac osx.2, vi editor, a pack of dos files to work on.
>When I open my files with vi I see some strin
On Mon, 30 Sep 2002, Chris wrote:
> Anyone else got a favorite editor for writing/converting text on MacOS
> X.2 when Unicode is important?
Vim claims to be able to do Farsi, Chinese, and other languages with non
western character sets & non western text flow, but personally I've never
had to de
You are probably seeing an artifact of encoding mismatch. The Terminal
will display UTF-8, but vi doesn't know about UTF-8, and is some of
your text coming from Classic MacOS or a DOS box? I find I need to use
an editor like jEdit which allows me good control over the text
encoding I intend.
On Monday, September 30, 2002, at 01:56 PM, Chris Devers wrote:
> Alternatively, if you can't find a good clean way to translate documents
> from one character set to another, you'll have to hand roll one. Surely
> there has to be tools for this but off the top of my head I can't think
> of
> an
On Mon, 30 Sep 2002, Adriano Allora wrote:
> Actual situation: I work with mac osx.2, vi editor, a pack of dos files
> to work on.
In particular, they seem to be in some kind of Windowsish character set
that doesn't seem to be translating cleanly to what Vi/$terminal/OSX wants
to be dealing with
On the one hand I didn't express myself very well, but for the other
hand I found other aspects of the problem.
Actual situation: I work with mac osx.2, vi editor, a pack of dos files
to work on.
When I open my files with vi I see some strings instead of stressed
letters and signs.
For instanc
the following in my ~/.login file:
alias mac2unix 'perl -pi -e "tr/\r/\n/"'
alias dos2unix 'perl -pi -e "tr/\r//d"'
-Ken
On Friday, September 27, 2002, at 03:26 AM, Robin wrote:
> On Friday, September 27, 2002, at 01:57 am, Adriano Allora wrot
On Friday, September 27, 2002, at 01:57 am, Adriano Allora wrote:
> I need to convert some dos files in unix files, are there commands I
> can use (like recode)?
I'm assuming you mean text files and you need to convert line endings.
You'll need to edit the @files array putting in the full pat
hi to all!
I need to convert some dos files in unix files, are there commands I can
use (like recode)?
thanks a lot,
adr
24 matches
Mail list logo