* 2 questions
@ 1995-10-31 16:13 Jose Unpingco
1995-11-01 8:46 ` P.Stephenson
0 siblings, 1 reply; 5+ messages in thread
From: Jose Unpingco @ 1995-10-31 16:13 UTC (permalink / raw)
To: zsh-users
1.) is it possible to assign standard output and/or standard error
from a job to a device after it has been put in the background.
For example,
% find . -name '*mat' -print &
then do something like
% %1 > /dev/null
2.) why is it that when I do history -f, I get dates and times that refer to
the latest login and not to the date and time of command execution in the
history.
For example,
105 10/21/1995 09:44 cd News <--- this command was run 10/20 not 10/21
106 10/21/1995 09:44 mail -f z <-- this is correct
thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2 questions
1995-10-31 16:13 2 questions Jose Unpingco
@ 1995-11-01 8:46 ` P.Stephenson
0 siblings, 0 replies; 5+ messages in thread
From: P.Stephenson @ 1995-11-01 8:46 UTC (permalink / raw)
To: Zsh users list
unpingco@ece.ucsd.edu wrote:
> 1.) is it possible to assign standard output and/or standard error
> from a job to a device after it has been put in the background.
>
> For example,
> % find . -name '*mat' -print &
> then do something like
> % %1 > /dev/null
There's no simple way of doing it, since that would require another
process to intercept the input and redirect it. That could only
happen if the target of the output is smart. In this case, it's just
the terminal, which is completely unable to distinguish where the
output is coming from.
Here's one possible way. The following script, 'transout', reads
lines from stdin and writes them to stdout by default. When you
create a file called "newout", it reads a new file name from that and
starts writing to that instead:
#!/bin/sh
while read line; do
if [ -f newout ]; then
exec >`cat newout`
rm -f newout
fi
echo $line
done
Now do what you want, with '| transout' stuck on the end:
% find . -name '*mat' -print | transout &
Output now comes to stdout. If you do
% echo /dev/null >newout
then output will go to /dev/null instead. You can make this more
sophisticated, obviously.
> 2.) why is it that when I do history -f, I get dates and times that refer to
> the latest login and not to the date and time of command execution in the
> history.
>
> For example,
>
> 105 10/21/1995 09:44 cd News <--- this command was run 10/20 not 10/21
> 106 10/21/1995 09:44 mail -f z <-- this is correct
Probably this is due to the problem with some versions of atol() which
don't like the : following the history date and won't convert the
number. This may have been fixed by now.
--
Peter Stephenson <pws@ifh.de> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2 questions
@ 2000-04-19 14:25 Sven Wischnowsky
0 siblings, 0 replies; 5+ messages in thread
From: Sven Wischnowsky @ 2000-04-19 14:25 UTC (permalink / raw)
To: zsh-users
Jason Price wrote:
> ...
>
> This is not exactly what I want. I'd rather have menu complete when it's
> non unique, defaulting to the first option, and allowing tab'ing or
> arrowing through the list. New completion setup is as follows:
>
> ...
>
> zstyle ':completion:*' menu select=200
Apart from what Oliver already said...
If you want tabbing through the matches you can either `setopt menucomplete'
or use
zstyle ':completion:*' menu yes
if you want arrowing, use:
zstyle ':completion:*' menu yes select
Using `select=200' is a bit weird, giving you selection only for
rather longish lists -- and exactly that combination doesn't work in
dev-22 (if the list doesn't fit on the screen). The CVS has some new
code for that.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2 questions
2000-04-18 18:24 Jason Price
@ 2000-04-18 20:52 ` Oliver Kiddle
0 siblings, 0 replies; 5+ messages in thread
From: Oliver Kiddle @ 2000-04-18 20:52 UTC (permalink / raw)
To: Jason Price; +Cc: Zsh Users
Jason Price wrote:
> 1) I'm trying to do a simple string match in an if statement, akin to how
> one is done in a case statement. Something like...:
This is done with if statements normally. All you need is:
if [[ "$var" = pattern ]]; then
Make sure that you don't quote the pattern otherwise it won't work.
> 2) I'm playing with dev-22, and trying to get things to work nice.
> Currently, across all completion, should I hit <tab>, all matches are
> printed onto the command line. Aka:
>
> ->ls p<tab>
>
> ->ls pc programs prompt
> pc@ prompt
> zstyle ':completion:*' completer _expand _complete _correct _approximate
> zstyle ':completion:*' completions 1
> zstyle ':completion:*' glob 0
> zstyle ':completion:*' substitute 0
The problem here is that you use the _expand completer with completions
1 but glob 0 and substitute 0. The _expand completer is expanding all
the completions on the command line. In general, I would only want to
use completions 1 with a more specific context. Probably your best bet
is to remove _expand from your list of completers but if you want it,
then try reading the appropriate sections of Peter's Zsh Guide (try
'User-friendly users guide' from the zsh web pages if you don't know
where to find it).
Oliver Kiddle
^ permalink raw reply [flat|nested] 5+ messages in thread
* 2 questions
@ 2000-04-18 18:24 Jason Price
2000-04-18 20:52 ` Oliver Kiddle
0 siblings, 1 reply; 5+ messages in thread
From: Jason Price @ 2000-04-18 18:24 UTC (permalink / raw)
To: zsh-users
I'm trying to get a couple of things to work. Unfortunatly, I'm pretty
sure both are simple... :(. I just can't figure it out.
1) I'm trying to do a simple string match in an if statement, akin to how
one is done in a case statement. Something like...:
case $var in
patern1* ) ;;
patern2* ) ;;
esac
if [[ "$var" in "patern1*" ]]; then
fi
I could do this in a case statement, but when you just have one if
condition...
2) I'm playing with dev-22, and trying to get things to work nice.
Currently, across all completion, should I hit <tab>, all matches are
printed onto the command line. Aka:
->ls
bin/ newcomplete.ps pc@ prompt
file nsmail/ programs/
->ls p<tab>
->ls pc programs prompt
pc@ prompt
programs:
bind/ gtar/ netscape/ vim/
gnu/ ncftp/ ssh/ zsh/
->ta<tab>
->ta tabs tail talk talkback tapes tapetool tar targs
->cd programs/g<tab>
->cd programs/gnu programs/gtar/
This is not exactly what I want. I'd rather have menu complete when it's
non unique, defaulting to the first option, and allowing tab'ing or
arrowing through the list. New completion setup is as follows:
# The following lines were added by compinstall
autoload -U compinit
compinit
[[ -z $fpath[(r)$_compdir] ]] && fpath=($fpath $_1ompdir)
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' completions 1
zstyle ':completion:*' glob 0
zstyle ':completion:*' ignore-parents parent pwd
zstyle ':completion:*' matcher-list '' 'r:|[._-]=* r:|=*' 'm:{a-zA-Z}={A-Za-z}'
zstyle ':completion:*' max-errors 1
zstyle ':completion:*' menu select=200
zstyle ':completion:*' squeeze-slashes true
zstyle ':completion:*' substitute 0
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose false
# End of lines added by compinstall
Any pointers would be greatly appreciated. If you need any more info,
please let me know.
Jason
--
Faith is not a matter of questions. Jason Price
Faith is a matter of answers. jprice@gatech.edu
More to the point, one answer: Theta Xi, Beta Alpha, 449
"Yes, Lord."
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-04-19 14:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-10-31 16:13 2 questions Jose Unpingco
1995-11-01 8:46 ` P.Stephenson
2000-04-18 18:24 Jason Price
2000-04-18 20:52 ` Oliver Kiddle
2000-04-19 14:25 Sven Wischnowsky
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).