zsh-users
 help / color / mirror / code / Atom feed
* Read/write multiple histories from non-interactive shell
@ 2023-02-13  7:35 OG Code Poet
  2023-02-13  7:43 ` Lawrence Velázquez
  2023-02-13  8:18 ` Roman Perepelitsa
  0 siblings, 2 replies; 6+ messages in thread
From: OG Code Poet @ 2023-02-13  7:35 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Let's say there is a non-interactive script with multiple form fields (each
with a different vared), and a user can enter the form multiple times. I
want to preserve individual history for each form field.

There are two possibilities:

1. Keep history internal to the script
        I couldn't find an interface for this. Doing ``fc -p`` once in the
beginning of script does provide an internal history, but it is shared
between all vareds (which is not ideal).
2. Keep history external to the script
        Not all ``fc`` commands work. ``fc -R`` does read correctly from
external history files. But ``print -s``, ``fc-W`` and ``fc -A`` do not.
Seems the only option is to do an echo "$string"
>>~/path//form_entry_1.hist file. But I guess that has disadvantages
because it lacks the benefits that zsh provides in resolving duplicates.

Is there a way out? Should this also be copied to zsh-workers for feature
request?

Thanks!

P.S. I can be slow to respond.

[-- Attachment #2: Type: text/html, Size: 1187 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-16  6:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13  7:35 Read/write multiple histories from non-interactive shell OG Code Poet
2023-02-13  7:43 ` Lawrence Velázquez
2023-02-13  8:18 ` Roman Perepelitsa
2023-02-13  8:57   ` OG Code Poet
2023-02-13  9:43     ` Roman Perepelitsa
2023-02-16  6:14       ` OG Code Poet

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).