zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: permission denied
Date: Fri, 21 Apr 2023 17:56:11 -0700	[thread overview]
Message-ID: <3f316bb9-63d6-7e08-16af-0730a4102d21@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ZuxiMADfnBZ0g+sp5yh=GxLRbi56OA2OeQuem+fBKaEw@mail.gmail.com>


On 2023-04-21 14:58, Bart Schaefer wrote:
>
> In this circumstance using eval would be much closer to correct.
That's how my system currently works, and it works fine, but I'm 
tinkering with any possible improvements, namely being able to use 
$chain1 instead of history.
> But
> --- why are you even bothering to split it at all if the intention is
> to run it?  I thought the point was to put it in the history or some
> other editable place as separate commands.

Yeah, it's all just experimentation.  Sometimes, indeed

% chain1

... cooks off and does something useful, other times 'eval' seems 
needed.  I don't think I've ever explained it well, but the only purpose 
is to be able to tinker with one of my functions in two steps: 1) what 
do I want? 2) how do I get it?  By writing and retrieving from history 
-- or a variable, I can do stage one tinkering very easily:


0 /aWorking/Zsh/Source/Wk 1 % l ,H h*     # ',H' switch saves to history

LISTING of "h*": All file types, INsensitive. Sorting upside down by: 
Mod. Time:

   640 [2022-12-22--07:12] highlight.css
  3307 [2023-01-19--16:17] h,1,light edits, old code removed
  3279 [2023-01-19--17:41] h,2,got n_list working
  3279 [2023-01-19--17:41] h

Items found: 4
Total bytes in directory "/aWorking/Zsh/Source/Wk": 1.5M
Total including subdirs: 25M

... press the up arrow (retrieve last command) and I get the 'real' 
command executed above:

0 /aWorking/Zsh/Source/Wk 1 % ls --time-style='+[%F--%H:%M]' 
--group-directories-first -AFrGgdt --color=always (#i)h* 2> /dev/null | 
sed -r "s/^(.{10} {1,3}[[:digit:]]{1,3} )/ /" | egrep -v '^total' | sed 
'/;34m\.\x1b\[0m\/$/d' | perl -pe "s|\] (.*?)(h)|\] \1^[[31;1m\2^[[0m|i"
   640 [2022-12-22--07:12] highlight.css
  3307 [2023-01-19--16:17] h,1,light edits, old code removed
  3279 [2023-01-19--17:41] h,2,got n_list working
  3279 [2023-01-19--17:41] h

... so if I want to tinker, I can edit the above 'real' command, and 
then, once I know what I want to change, I go to my own code, which 
constructs the above, and make it construct it with the desired 
modification.  Two steps.  So, in practice, I'll never need to worry 
about multi-command command lines.  It's all a bit involved but as I do 
it now 'eval' is always used.

If you ever have a morbid curiosity about what I've been doing all these 
years:

https://github.com/RayAndrews56/zsh-wrappers

... I'd be most interested in a review!  'c' and 'h' really are 
genuinely useful.



>


  reply	other threads:[~2023-04-22  0:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 18:34 Ray Andrews
2023-04-17 19:07 ` Roman Perepelitsa
2023-04-17 20:41   ` Ray Andrews
2023-04-17 21:52     ` Bart Schaefer
2023-04-17 22:44       ` Ray Andrews
2023-04-18  2:41         ` Bart Schaefer
2023-04-18  3:35           ` Ray Andrews
2023-04-20 21:35             ` Ray Andrews
2023-04-20 21:47               ` Roman Perepelitsa
2023-04-20 22:09                 ` Ray Andrews
2023-04-20 22:13                   ` Bart Schaefer
2023-04-20 22:47                     ` Ray Andrews
2023-04-21  3:12                       ` Bart Schaefer
2023-04-21 13:33                         ` Ray Andrews
2023-04-21 14:12                           ` Peter Stephenson
2023-04-21 14:42                             ` Ray Andrews
2023-04-21 21:58                               ` Bart Schaefer
2023-04-22  0:56                                 ` Ray Andrews [this message]
2023-04-20 22:17                   ` Roman Perepelitsa
  -- strict thread matches above, loose matches on Subject: below --
2020-12-21 23:01 Ray Andrews

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=3f316bb9-63d6-7e08-16af-0730a4102d21@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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.
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).