Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 48:47:53 |
Calls: | 422 |
Files: | 1,024 |
Messages: | 90,436 |
On 30 Mar 2025 22:04:45 GMT, Stéphane CARPENTIER wrote:
Yes, with the right option and/or with the right modification of the
command line. But it's easier and faster to just add a cat than to find
the "right" way to do it.
Give an example.
Le 31-03-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
On 30 Mar 2025 22:04:45 GMT, Stéphane CARPENTIER wrote:
Yes, with the right option and/or with the right modification of the
command line. But it's easier and faster to just add a cat than to
find the "right" way to do it.
Give an example.
A lot of time I run cat to find some information in a file. And when the
file is bigger than expected, I'll just grep its output. Of course,
it's better to directly grep the file, but it's easier and faster to add
a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
Le 31-03-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
On 30 Mar 2025 22:04:45 GMT, Stéphane CARPENTIER wrote:
Yes, with the right option and/or with the right modification of the
command line. But it's easier and faster to just add a cat than to
find the "right" way to do it.
Give an example.
A lot of time I run cat to find some information in a file. And when the
file is bigger than expected, I'll just grep its output. Of course,
it's better to directly grep the file, but it's easier and faster to add
a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
You do have command-line editing enabled, right? You just press the HOME
key (or CTRL/A) to go to the start of the line.
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
A lot of time I run cat to find some information in a file. And when theYou do have command-line editing enabled, right? You just press the HOME
file is bigger than expected, I'll just grep its output. Of course,
it's better to directly grep the file, but it's easier and faster to add
a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
key (or CTRL/A) to go to the start of the line.
In comp.os.linux.misc, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
A lot of time I run cat to find some information in a file. And when the >>> file is bigger than expected, I'll just grep its output. Of course,You do have command-line editing enabled, right? You just press the HOME
it's better to directly grep the file, but it's easier and faster to add >>> a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
key (or CTRL/A) to go to the start of the line.
Very presumptious to assume emacs style line editing, isn't it?
To go back in history, I type <ESC>k and then I'm at the start of the
line of the most recent command. On the current line I'd type <ESC>^
but <ESC><HOME> would work.
But really, I don't think it is proper to care about inefficent use of commands at the command line. Go ahead and judge in a script or
documentation (or an example posted to Usenet), but what people do in
the privacy of their own shell is their business.
Very presumptious to assume emacs style line editing, isn't it?
But really, I don't think it is proper to care about inefficent use of commands at the command line.
Very presumptious to assume emacs style line editing, isn't it?
To go back in history, I type <ESC>k and then I'm at the start of the
line of the most recent command. On the current line I'd type <ESC>^
but <ESC><HOME> would work.
The only time I've had to use vi command history editing was with some
old version of VxWorks. It was the only kind included by default. I
ended up teaching some colleagues on how to edit the command line, vi
style.
On Tue, 08 Apr 2025 15:39:47 +0300, Anssi Saari wrote:
The only time I've had to use vi command history editing was with some
old version of VxWorks. It was the only kind included by default. I
ended up teaching some colleagues on how to edit the command line, vi
style.
Seems a bit dumb, having to go into insert mode every time you actually
want to type a command.
Seems a bit dumb, having to go into insert mode every time you actually
want to type a command.
On 4/8/25 9:16 PM, Lawrence D'Oliveiro wrote:
On Tue, 08 Apr 2025 15:39:47 +0300, Anssi Saari wrote:
The only time I've had to use vi command history editing was with some
old version of VxWorks. It was the only kind included by default. I
ended up teaching some colleagues on how to edit the command line, vi
style.
Seems a bit dumb, having to go into insert mode every time you actually
want to type a command.
It's terrible - and was obsolete already by 1985.
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
Le 31-03-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
On 30 Mar 2025 22:04:45 GMT, Stéphane CARPENTIER wrote:
Yes, with the right option and/or with the right modification of the
command line. But it's easier and faster to just add a cat than to
find the "right" way to do it.
Give an example.
A lot of time I run cat to find some information in a file. And when the
file is bigger than expected, I'll just grep its output. Of course,
it's better to directly grep the file, but it's easier and faster to add
a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
You do have command-line editing enabled, right? You just press the HOME
key (or CTRL/A) to go to the start of the line.
In comp.os.linux.misc, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On 06 Apr 2025 08:40:54 GMT, Stéphane CARPENTIER wrote:
A lot of time I run cat to find some information in a file. And when the >>> file is bigger than expected, I'll just grep its output. Of course,You do have command-line editing enabled, right? You just press the HOME
it's better to directly grep the file, but it's easier and faster to add >>> a grep at the end of the previous command than to either write directly
the right command or to go at the beginning of the line to remove the
cat and put grep instead. Mostly when the name of the file is long in a
far remote directory.
key (or CTRL/A) to go to the start of the line.
Very presumptious to assume emacs style line editing, isn't it?
But really, I don't think it is proper to care about inefficent use of commands at the command line.
Go ahead and judge in a script or documentation (or an example posted
to Usenet), but what people do in the privacy of their own shell is
their business.
On Wed, 9 Apr 2025 13:26:48 +0100, Geoff Clare wrote:
On 4/8/25 9:16 PM, Lawrence D'Oliveiro wrote:
Seems a bit dumb, having to go into insert mode every time youThat's not how it works.
actually want to type a command.
But that’s how the vi/vim editor family works. Are you saying that a command-line editor that is supposed to work like those editors doesn’t in fact, emulate them entirely faithfully?
Yes. And then, I have to remove "cat". And only then can I write "grep". Which is more difficult than just writing "| grep" at the end of the
line.
On 12 Apr 2025 11:23:14 GMT, Stéphane CARPENTIER wrote:
Yes. And then, I have to remove "cat". And only then can I write "grep".
Which is more difficult than just writing "| grep" at the end of the
line.
Let’s see:
* CTRL/A, DEL, DEL, DEL, “grep” (8 keystrokes)
versus
* “|grep” (5 keystrokes)
That’s 60% more work. I suppose that’s a big chunk out of your working day ...
On 12 Apr 2025 11:23:14 GMT, Stéphane CARPENTIER wrote:
Yes. And then, I have to remove "cat". And only then can I write "grep".
Which is more difficult than just writing "| grep" at the end of the
line.
Let’s see:
* CTRL/A, DEL, DEL, DEL, “grep” (8 keystrokes)
versus
* “|grep” (5 keystrokes)
That’s 60% more work. I suppose that’s a big chunk out of your working day ...
Here’s an even more useless example:
cat «file» | grep «pattern» | wc -l
versus
grep -c «pattern» «file»
So why do you want to fight the UUOC?
Why should I follow your advice?
Lawrence D'Oliveiro <ldo@nz.invalid> writes:
Seems a bit dumb, having to go into insert mode every time you actually
want to type a command.
Sure. Still, way better than no command history at all.
On 4/8/25 9:16 PM, Lawrence D'Oliveiro wrote:
On Tue, 08 Apr 2025 15:39:47 +0300, Anssi Saari wrote:
The only time I've had to use vi command history editing was with
some old version of VxWorks. It was the only kind included by
default. I ended up teaching some colleagues on how to edit the
command line, vi style.
Seems a bit dumb, having to go into insert mode every time you
actually want to type a command.
That's not how it works.
After the shell writes a command prompt, it is
in insert mode, so you just type a command as normal. To edit the
current command, or search the history, you type ESC to get out of
insert mode and then perform the edit or search just like in vi (except
that RETURN executes the edited command instead of moving to the next "line").
It became an IEEE standard in 1992 (and ISO in 1993) for
POSIX-conforming shells, and has remained standard to this day. IEEE
chose not to include emacs mode, so effectively it is emacs mode that
was treated as obsolete (in 1992).
On 13 Apr 2025 18:25:56 GMT, Stéphane CARPENTIER wrote:
So why do you want to fight the UUOC?
I don’t.
Why should I follow your advice?
You don’t.
All I do is point it out. I don’t even have to say “this is uncool”, you
yourself come to the conclusion that they are somehow an uncool way of
doing things.
Le 14-04-2025, Lawrence D'Oliveiro <ldo@nz.invalid> a écrit :
On 13 Apr 2025 18:25:56 GMT, Stéphane CARPENTIER wrote:
So why do you want to fight the UUOC?
I don’t.
Why should I follow your advice?
You don’t.
All I do is point it out. I don’t even have to say “this is uncool”, you
yourself come to the conclusion that they are somehow an uncool way of
doing things.
The name UUOC, by itself, means it's uncool to do it.