zsh-users
 help / color / mirror / code / Atom feed
* Re: Perl like select()?
@ 1999-08-25 16:26 Jay Sekora
  0 siblings, 0 replies; 9+ messages in thread
From: Jay Sekora @ 1999-08-25 16:26 UTC (permalink / raw)
  To: Josh Howard; +Cc: zsh-users

> For instance: I have a shell script that I want to 
> simply put ">log.file" at the top, and then start echo'ing and doing
> various output and expect everything to go to log.file, as opposed to
> doing something like "./script.sh >> log.file"

In the Bourne shell, you use "exec" with redirection and no command, 
thusly:

  #!/bin/zsh
  exec > /tmp/foo
  echo this is a test

And empirically, this works in zsh as well (3.0.5), although the section 
on "exec" in zshmisc(1) doesn't seem to imply that it should.

-j.


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Perl like select()?
@ 1999-08-25 15:48 Josh Howard
  1999-08-25 16:16 ` Zefram
  0 siblings, 1 reply; 9+ messages in thread
From: Josh Howard @ 1999-08-25 15:48 UTC (permalink / raw)
  To: zsh-users

Is there any way, in a script, to use a "Perl-like" select() to
associate stdout with a particular file, before the execution of the
rest of the script? For instance: I have a shell script that I want to 
simply put ">log.file" at the top, and then start echo'ing and doing
various output and expect everything to go to log.file, as opposed to
doing something like "./script.sh >> log.file"
In perl, you can open() and select() a file to associate where stdout
is written to. This might be a useful feature in zsh if it doesn't
already exist.


-- 
Josh Howard <jrh@vicor-nb.com>


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

end of thread, other threads:[~1999-08-27 10:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-25 16:26 Perl like select()? Jay Sekora
  -- strict thread matches above, loose matches on Subject: below --
1999-08-25 15:48 Josh Howard
1999-08-25 16:16 ` Zefram
1999-08-25 16:48   ` Owen M. Astley
1999-08-25 17:00     ` Bart Schaefer
1999-08-25 17:08       ` Owen M. Astley
1999-08-25 16:49   ` Bart Schaefer
1999-08-25 18:35   ` Josh Howard
1999-08-27 10:56   ` Nemeth Ervin

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