zsh-users
 help / color / mirror / code / Atom feed
* read builtin
@ 1997-07-15 16:58 Jason Zapman II
  1997-07-15 17:08 ` Andrew Main
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Zapman II @ 1997-07-15 16:58 UTC (permalink / raw)
  To: zsh-users

I'm confused.  (not that that's very suprising...)

I'm trying to write a script to automate some tasks here for others who
have a problem remembering all of the command line switches.  So, I'm
making it output questions, and reading responces back in.  I'm trying to
do this with the read builtin.

My first attempt is:

read DIRE?'What directory do you want them to use? [full path] '

This errors out with No matches found DIRE?That...

According to the docs:

`read [ -rzpqAclneE ] [ -k [NUM] ] [ -uN ] [ NAME?PROMPT ] [ NAME ... ]'
...
     If the first argument contains a `?', the remainder of this word is
     used as a `prompt' on standard error when the shell is
     interactive.  The exit status is `0' unless an end-of-file is
     encountered.

What am I doing wrong?

Thanks;
Jason

-- 
Jason Price  Theta Xi, BA 449 /    All that is gold does not glitter.
aspiring CompSci major        /    Not all those who wander are lost.
Georgia Tech Penitentiary     /    --- J.R.R. Tolkien
zapman@cc.gatech.edu          /


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

* Re: read builtin
  1997-07-15 16:58 read builtin Jason Zapman II
@ 1997-07-15 17:08 ` Andrew Main
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Main @ 1997-07-15 17:08 UTC (permalink / raw)
  To: Jason Zapman II; +Cc: zsh-users

Jason Zapman II wrote:
>read DIRE?'What directory do you want them to use? [full path] '

Put the ? inside the quotes:

read DIRE'?What directory do you want them to use? [full path] '

-zefram


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

* Re: read builtin
@ 1997-07-15 17:06 Wolfgang Hukriede
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Hukriede @ 1997-07-15 17:06 UTC (permalink / raw)
  To: zsh-users, zapman

zapman@cc.gatech.edu (Jason Zapman II) wrote:

> My first attempt is:
> read DIRE?'What directory do you want them to use? [full path] '

say:

   read 'DIRE?What directory do you want them to use? [full path] '

otherwise the shell tries to expand the '?'.

greetings, Wolfgang.


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

end of thread, other threads:[~1997-07-15 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-15 16:58 read builtin Jason Zapman II
1997-07-15 17:08 ` Andrew Main
1997-07-15 17:06 Wolfgang Hukriede

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