Activity for alx
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #289931 |
Post edited: |
— | 7 months ago |
Edit | Post #289931 |
Post edited: |
— | 7 months ago |
Edit | Post #289931 |
Post edited: |
— | 7 months ago |
Edit | Post #289931 |
Post edited: |
— | 7 months ago |
Edit | Post #289931 |
Post edited: |
— | 7 months ago |
Edit | Post #289931 | Initial revision | — | 7 months ago |
Answer | — |
A: How to overwrite each line of STDOUT with the next one? Instead of having new stdout lines overwrite the previous one, it seems better to specify that old stdout lines should be overwritten by anything that comes after them. This has the benefit that stdout cannot overwrite stderr (or anything else that goes in the tty). ```sh #!/bin/sh setterm ... (more) |
— | 7 months ago |
Comment | Post #289899 |
Why set `lines=` to empty before entering the alternate screen? (more) |
— | 7 months ago |
Comment | Post #289899 |
Why are the two trap(1) calls at different locations? (more) |
— | 7 months ago |
Comment | Post #289899 |
Makes sense. Thanks! (more) |
— | 7 months ago |
Comment | Post #289899 |
Thanks Kamil! Makes sense.
@quasimodo, no, that would have the same problems as my suggestion. (more) |
— | 7 months ago |
Comment | Post #289899 |
Why do you need the `echo x` trick? What happens without it?
I think this would be simpler:
```sh
...
lines="$(tee /dev/tty | tail -n "$n")"
leave
printf '%s\n' "$lines"
```
Am I missing anything?
(more) |
— | 7 months ago |
Comment | Post #289899 |
What's the reason for redirecting the whole `enter()` and `leave()` functions to /dev/tty?
Do both setterm(1) and tput(1) need to be redirected? Or is it only necessary to redirect one of them? (more) |
— | 7 months ago |
Comment | Post #289875 |
Thanks!
Just a minor nitpick: `$COLUMNS` is not available (unless I export it manually). I replaced it with `tput cols`:
```sh
$ cat /usr/local/bin/ovr
#!/bin/sh
sed "s/^\(.\{,$(tput cols)\}\).*$/\1/;2,\$s/^/\x1B[1A\x1B[K/";
```
(see <https://stackoverflow.com/a/263900>) (more) |
— | 7 months ago |
Edit | Post #289876 |
Post edited: |
— | 7 months ago |
Edit | Post #289876 |
Post edited: |
— | 7 months ago |
Edit | Post #289876 |
Post edited: |
— | 7 months ago |
Edit | Post #289876 | Initial revision | — | 7 months ago |
Answer | — |
A: Ergonomic way to search man pages Unix filters are quite handy. First of all, you can get an index of any manual page with a simple grep(1): ```sh $ man pacman | grep '^[^ ]' PACMAN(8) Pacman Manual PACMAN(8) NAME SYNOPSIS DESCRIPTION OPERATIONS OPTIONS TRANSACTION OP... (more) |
— | 7 months ago |
Edit | Post #289869 |
Post edited: |
— | 7 months ago |
Edit | Post #289869 | Initial revision | — | 7 months ago |
Question | — |
How to overwrite each line of STDOUT with the next one? I wrote a filter program to overwrite each line with the next one. ```sh $ cat /usr/local/bin/ovr #!/bin/sh sed '2,$s/^/\x1B[1A\x1B[K/'; ``` Here's the behavior: ```sh $ echo | ovr $ echo 'foo' | ovr foo $ echo -e 'foo\nbar' | ovr bar $ echo -e 'foo\nbar\nbaz' | ovr baz $ ech... (more) |
— | 7 months ago |
Edit | Post #289854 |
Post edited: |
— | 7 months ago |
Edit | Post #289854 |
Post edited: |
— | 7 months ago |
Edit | Post #289854 |
Post edited: |
— | 7 months ago |
Edit | Post #289854 | Initial revision | — | 7 months ago |
Answer | — |
A: How to get a mailto: URI out of abook(1) There's no such feature. But it's easy to write. Apply this patch: ```diff From 8ea7d1cf4933ca24006308ac61aa50fb8ab33b02 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 30 Sep 2023 17:44:03 +0200 Subject: [PATCH] query: outformat: Add "mailto" format Signed-off-by: Alejandro ... (more) |
— | 7 months ago |
Comment | Post #289799 |
Yep. I hoped there was a way that I didn't find, but it seems the way is brute force. (more) |
— | 7 months ago |
Edit | Post #289799 |
Post edited: Add example of expected result |
— | 7 months ago |
Edit | Post #289799 | Initial revision | — | 8 months ago |
Question | — |
How to get a mailto: URI out of abook(1) I store my address book with abook(1). Let's say I want to introduce some contact in some field that accepts the usual `name ` format. How can I ask abook(1) to produce that format? The addressbook entry is the following: ``` [0] name=Alejandro Colomar email=alx@kernel.org,alx.manp... (more) |
— | 8 months ago |
Edit | Post #289717 | Initial revision | — | 8 months ago |
Question | — |
How to see all header fields of an email in mutt? Neomutt (and probably Mutt too, but I didn't try) seems to be hiding header fields from email, such as the Message-ID field, and fields that are added by SMTP servers when they receive the message. How can one ask it to show the entire mail source, as if one was reading the file itself? In othe... (more) |
— | 8 months ago |
Edit | Post #286875 |
Post edited: |
— | over 1 year ago |
Edit | Post #286875 |
Post edited: |
— | over 1 year ago |
Edit | Post #286875 | Initial revision | — | over 1 year ago |
Question | — |
Who creates subdirs under `/run`? A system daemon needs to create several files under `/run/program-name/` (and possibly other subdirs of that). They are the PID file, and at least one Unix socket file (but maybe more). The FHS specifies that those files go there, under a `/run` subdir: . (In some Unix systems, it would still be `... (more) |
— | over 1 year ago |
- ← Previous
- 1
- 2
- 3
- 4
- Next →