bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ed] Trailing spaces in filenames


From: Gabriel Farrell
Subject: Re: [Bug-ed] Trailing spaces in filenames
Date: Mon, 15 Dec 2014 15:29:38 -0500

On Mon, Dec 15, 2014 at 1:33 PM, Antonio Diaz Diaz <address@hidden> wrote:
> Gabriel Farrell wrote:
>>
>> Well, ed currently ignores leading spaces. And vi and ex both ignore
>> leading and trailing.
>
> Ed does not ignore leading spaces. You only need to escape them:
>
> $ echo "Hello, world" > " a.txt"
> $ ed -v
> e \ a.txt
> 13
> ,p
> Hello, world
> f
>  a.txt
> q
> $

Yes! My point exactly. It's inconsistent!

  Spaces before filename: counted only when escaped
  Spaces after filename: counted even when they're not escaped

This small change leads us to a saner world where spaces on both sides
of the filename are only counted when escaped. And that is good
because this escaping is useful only in those rare, unsettling cases
when a filename must begin or end with spaces.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]