Re: interesting question about shells

2014-12-26 Thread Wayne Cuddy
Bash and Zsh will already handle your first example without any
tinkering.

As Christian stated the completion systems are quite mature, I tend to
prefer zsh myself.

A good book that I recommend to get started is From Bash to Zsh. I
found it easier to start with rather the supplied reference
documentation.

Hope that helps,
Wayne

On Wed, Dec 24, 2014 at 04:56:02PM +0200, Gregory Edigarov wrote:
 Hi,
 
 an interesting question has just come to my head:
 do you know of any shell that could complete from the terminal output of 
 any of the previous command?
 
 like for example:
 i want it to complete from a result of ls, so I give the ls command, 
 look at its output, then for example
 i type 'cat  some prefixTAB' and it completes from the result of ls.
 now if i want for example  ssh to any host, i give command cat 
 .ssh/config, and then ssh some prefixTAB.
 is that at all possible?
 
 --
 With best regards,
  Gregory Edigarov



Re: interesting question about shells

2014-12-26 Thread Jonathon Sisson
On Fri, Dec 26, 2014 at 03:48:43PM -0500, Wayne Cuddy wrote:
 A good book that I recommend to get started is From Bash to Zsh. I
 found it easier to start with rather the supplied reference
 documentation.
 
Does From Bash to Zsh cover ksh, csh, tcsh, etc...?

It sounds like a great book idea, but it looks to me like the book
literally just covers Bash and Zsh?  Is that the case?



Re: interesting question about shells

2014-12-26 Thread Wayne Cuddy
No really.. a lot of the basics are applicable to ksh (*sh) but *csh
style shells aren't covered.

On Fri, Dec 26, 2014 at 04:54:16PM -0500, Jonathon Sisson wrote:
 On Fri, Dec 26, 2014 at 03:48:43PM -0500, Wayne Cuddy wrote:
  A good book that I recommend to get started is From Bash to Zsh. I
  found it easier to start with rather the supplied reference
  documentation.
  
 Does From Bash to Zsh cover ksh, csh, tcsh, etc...?
 
 It sounds like a great book idea, but it looks to me like the book
 literally just covers Bash and Zsh?  Is that the case?



Re: interesting question about shells

2014-12-24 Thread Christian Weisgerber
On 2014-12-24, Gregory Edigarov ediga...@qarea.com wrote:

 an interesting question has just come to my head:
 do you know of any shell that could complete from the terminal output of 
 any of the previous command?

That would require serious contortions since the stdout/stderr
output of commands run from the shell does not pass through the
shell.

 i type 'cat  some prefixTAB' and it completes from the result of ls.
 now if i want for example  ssh to any host, i give command cat 
 .ssh/config, and then ssh some prefixTAB.
 is that at all possible?

bash, tcsh, and zsh each support absurdly complex programmable
completion schemes that may offer better ways to do what you want.
(E.g. why complete ssh from previous cat output, why not complete
directly from .ssh/config or .ssh/known_hosts?)

-- 
Christian naddy Weisgerber  na...@mips.inka.de



Re: interesting question about shells

2014-12-24 Thread Francois Pussault
 
 From: Gregory Edigarov ediga...@qarea.com
 Sent: Wed Dec 24 15:56:02 CET 2014
 To: misc@openbsd.org
 Subject: interesting question about shells
 
 
 Hi,
 
 an interesting question has just come to my head:
 do you know of any shell that could complete from the terminal output of 
 any of the previous command?
 
 like for example:
 i want it to complete from a result of ls, so I give the ls command, 
 look at its output, then for example
 i type 'cat  some prefixTAB' and it completes from the result of ls.
 now if i want for example  ssh to any host, i give command cat 
 .ssh/config, and then ssh some prefixTAB.
 is that at all possible?
 
 --
 With best regards,
   Gregory Edigarov
 

Hi

I don't think any shells use that since you can do so in many ways... 

. | xargs .

you can use a named pipe 
command  /dev/mypipe  
command  /dev/mypipe

etc...
etc...
etc...



Cordialement
Francois Pussault
10 chemin de négo saoumos
apt 202 - bat 2
31300 Toulouse
+33 6 17 230 820   +33 5 34 365 269 
fpussa...@contactoffice.fr



Re: interesting question about shells

2014-12-24 Thread Gregory Edigarov

On 12/24/2014 06:19 PM, Christian Weisgerber wrote:

On 2014-12-24, Gregory Edigarov ediga...@qarea.com wrote:


an interesting question has just come to my head:
do you know of any shell that could complete from the terminal output of
any of the previous command?

That would require serious contortions since the stdout/stderr
output of commands run from the shell does not pass through the
shell.


i type 'cat  some prefixTAB' and it completes from the result of ls.
now if i want for example  ssh to any host, i give command cat
.ssh/config, and then ssh some prefixTAB.
is that at all possible?

bash, tcsh, and zsh each support absurdly complex programmable
completion schemes that may offer better ways to do what you want.
(E.g. why complete ssh from previous cat output, why not complete
directly from .ssh/config or .ssh/known_hosts?)


hmmm... that were only an examples of application...