The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: michael@kjorling.se (Michael Kjörling)
Subject: [TUHS] TECO was: Re: basic tools / Universal Unix
Date: Fri, 17 Nov 2017 08:44:19 +0000	[thread overview]
Message-ID: <20171117084419.GA6171@h-174-65.A328.priv.bahnhof.se> (raw)
In-Reply-To: <CAKr6gn3Ub7ve0G0dSAviXAe5q6CDUN-mY7ghxhR2Ztyhsh7KCQ@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

On 17 Nov 2017 10:38 +0800, from ggm at algebras.org (George Michaelson):
> although why find . -type d -maxdepth 1 isn't being used is beyond me.

(In normal usage) unless you want your dot-directories as well,
there's always good ol' \ls -1d */, or even echo */ if you can live
with the entries being all on one line separated by just one space.
Works nicely in an interactive shell, but may be slightly too
unreliable for a script (in GNU bash, the exact behavior depends on
the globbing options such as dotglob; other shells might act
differently based on state too, I just am not too familiar with them).

Using \ls above because some people (including myself) already have
their ls aliased to a ls command that includes -F, which looks ugly
when used with -d */. If you aren't one of them, then maybe you don't
need the backslash.

Using echo has the bonus that it's very often built in to the shell,
so no external invocation is required.

I don't think I'd call find minimalistic anything. :-) Modern ls is
pretty bloated too (surprisingly enough, on my system, the binary for
find is only about twice the size of the binary for ls; 233,968 and
114,032 bytes, respectively, but that's not counting any libraries
they pull in dynamically), but ls is probably in the disk cache
already; echo's nice and lean, though...

-- 
Michael Kjörling • https://michael.kjorling.se • michael at kjorling.se
                 “People who think they know everything really annoy
                 those of us who know we don’t.” (Bjarne Stroustrup)


  parent reply	other threads:[~2017-11-17  8:44 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 14:16 [TUHS] " Noel Chiappa
2017-10-30 14:40 ` Clem Cole
2017-10-30 15:23 ` Arthur Krewat
2017-10-30 20:56 ` Dave Horsfall
2017-10-31 10:50   ` Ronald Natalie
2017-11-01  3:23     ` Dave Horsfall
2017-11-01 13:25       ` Tim Bradshaw
2017-11-16  1:17         ` Dario Niedermann
2017-11-15  1:25       ` Nemo
2017-11-15  2:10         ` Will Senn
2017-11-15  2:16           ` Larry McVoy
2017-11-15  2:37             ` Warner Losh
2017-11-15  3:07               ` Will Senn
2017-11-15 16:13                 ` Arthur Krewat
2017-11-15 16:23                   ` Arthur Krewat
2017-11-15 16:48                     ` Clem Cole
2017-11-15 18:13                       ` Bakul Shah
2017-11-15 19:01                         ` Clem Cole
2017-11-15 19:52                           ` [TUHS] TECO was: " Arthur Krewat
2017-11-15 20:19                             ` Clem Cole
2017-11-15 20:25                               ` Arthur Krewat
2017-11-15 22:18                                 ` Ralph Corderoy
2017-11-15 22:42                                   ` [TUHS] :nohlsearch in vim Chris Torek
2017-11-16  2:44                                     ` Don Hopkins
2017-11-16  4:34                                   ` [TUHS] TECO was: Re: basic tools / Universal Unix Dave Horsfall
2017-11-16  4:36                                     ` Jim Capp
2017-11-16  8:42                                     ` Pete Turnbull
2017-11-18 14:39                                       ` Ralph Corderoy
2017-11-16  9:19                                     ` arnold
2017-11-16 21:59                                     ` Dave Horsfall
2017-11-16 22:58                                       ` Andy Kosela
2017-11-17  2:17                                         ` Steve Johnson
2017-11-17  2:38                                           ` George Michaelson
2017-11-17  3:56                                             ` Ian Zimmerman
2017-11-17  4:07                                               ` Steve Nickolas
2017-11-17  8:44                                             ` Michael Kjörling [this message]
2017-11-17  3:50                                         ` Lyndon Nerenberg
2017-11-17  6:51                                           ` Andy Kosela
2017-11-17  1:18                                     ` Greg 'groggy' Lehey
2017-11-16  0:29                                 ` Grant Taylor
2017-11-16  0:35                                   ` Grant Taylor
2017-11-16  0:52                                     ` Warner Losh
2017-11-16  9:29                             ` [TUHS] TECO was: " Mutiny 
2017-11-16 14:55                               ` Clem Cole
2017-11-16 21:26                                 ` Random832
2017-11-17  9:08                                   ` Mutiny 
2017-11-16 20:35                               ` Dave Horsfall
2017-11-16 21:00                                 ` Clem Cole
2017-11-17  6:28                               ` Lars Brinkhoff
2017-11-15  9:58               ` [TUHS] " Andy Kosela
2017-11-15 11:42           ` Ralph Corderoy
2017-11-01 14:05     ` Ralph Corderoy
2017-11-01 16:42       ` arnold
2017-11-01 17:17         ` Ralph Corderoy
2017-11-01 18:03           ` Dan Cross
2017-11-01 18:06           ` arnold
2017-11-01 20:16             ` Bakul Shah
2017-11-01 20:37               ` arnold
2017-11-01 21:04                 ` Bakul Shah
2017-11-02  0:05                 ` Chet Ramey
2017-11-02  0:10             ` Ralph Corderoy
2017-10-31 16:43   ` Don Hopkins
2017-11-02 17:48   ` Paul Winalski
2017-10-30 21:50 ` Charles Anthony
2017-11-16 23:15 [TUHS] TECO was: " Doug McIlroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171117084419.GA6171@h-174-65.A328.priv.bahnhof.se \
    --to=michael@kjorling.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).