bug-ed
[Top][All Lists]
Advanced

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

Re: Is a directory


From: Bob Proulx
Subject: Re: Is a directory
Date: Sun, 15 Nov 2020 12:44:45 -0700

Dan Jacobson wrote:
> $ ed /cf/updates/couchsurfing/*ref*

This feels like an incautious use of wild card characters.  But if you
know it will only match files then that is okay.

It's probably a good idea to double check that wild card matches like
this only match what you think it will match and not something
unexpected.

    ls -ld /cf/updates/couchsurfing/*ref*

> Is a directory #OK, but say what.

Apparently one of your wild card expansions matched a directory.  That
is why it is good to use file globs that make sense to use and avoid
using those that are too lax and match too much.

It would have said exactly that as a response.  "Is a directory".  For
which the traditional rationale would be that the experienced ed user
would know what they did.

> q #And why do I need to type this. Why doesn't it just quit by itself?

It does not quit by itself because the editor should not do this as it
does not know if you want to quit or to continue with doing something
else.

The user is perfectly capable of entering text and writing it to a
different file should they choose to do so.

    $ ed /tmp
    Is a directory
    a
    This is my text.  It is nothing to write home about.
    .
    w letter-home.txt
    53
    q
    $ ls -ld letter-home.txt
    -rw-rw-r-- 1 rwp rwp 53 Nov 15 12:36 letter-home.txt

> #OK, maybe it is expecting I will do some different commands before quitting.

Correct.

Bob



reply via email to

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