Zsh Mailing List Archive
Messages sorted by:
Re: write a command line.
- X-seq: zsh-users 17008
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: write a command line.
- Date: Sat, 14 Apr 2012 12:42:44 -0700
- In-reply-to: <CAH+w=7aGz_4A0yZ1_eLEzSs6wO_nqrX6NmV52VUdO=hi+B9-Yg@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4F885F3B.firstname.lastname@example.org> <CAHYJk3QsbkN4nH2XmST=b-xf+tLFDS6=mP7mpETuvpFc3424jw@mail.gmail.com> <4F899B07.email@example.com> <CAH+w=7aGz_4A0yZ1_eLEzSs6wO_nqrX6NmV52VUdO=hi+B9-Yg@mail.gmail.com>
On 14/04/12 12:03 PM, Bart Schaefer wrote:
Right. Especially when Googling, one must use the correct words. But
Mikael is smarter than Google so he sees what I want even though my
terminology is poor.
On Sat, Apr 14, 2012 at 8:43 AM, Ray Andrews<rayandrews@xxxxxxxxxxx> wrote:
It's mostly a question of knowing how to express the problem.
This can indeed be the most difficult part, particularly becoming
familiar with the terminology. Just as an example:
Another problem is that one's knowledge of an OS is like an iceberg, 90%
of it is underwater. Those who are longtime users of Linux/zsh take a
huge number of things for granted which means that most of what they
know they know without knowing that they know it, so to speak. For the
new person, coming from DOS or Windows, that body of unconcious
knowledge is quite different so many assumptions are wrong.
Now I can just create my command inside
the script, save it as '$string' and: 'print -z $string' does the trick.
Usually a "script" refers to something that runs as a stand-alone
program separate from an interactive shell. "print -z" in a script
would be meaningless, whereas your original solution of appending to
the incrementally-shared history file works perfectly for such an
external program. If "print -z" really works for you, you must be
referring to a "function" rather than a "script.
Well, as a trivial example, this works:
export string="echo $PATH"
print -z $string
Very true. For example with my problem people were trying to help me
with 'zle' and 'bindkey' whereas the real problem was ignored. Mikael
saw that 'zle' and 'bindkey' are irrelevant, they are only 'A,B,C'
whereas what is wanted is 'X'.
The way I've expressed it, people seem
to think I'm looking for something complicated.
An extremely common mistake is:
I have problem X. I come up with a solution which involves steps A,
B, C, and D, but I run into a problem at step C. Instead of
describing the original problem X, I attempt to describe the execution
of C, and everyone gets lost in the details. If I'd described X in
the first place, I might have learned that I was already going wrong
at step B, which is why C is causing such a headache.
The best part about starting with X is that *usually* the description
of X does not need to discuss whether the solution involves a script
or a function or any of the other terminology that might cause
Messages sorted by: