Re: befehl/möglichkeit für ein shellscript gesucht
Am Fr 22.09.2006 22:35 schrieb Florian (flobee) <flobee@gmx.net>:
> Hallo
>
> Ulf Volmer wrote:
> > On Fri, Sep 22, 2006 at 10:07:32PM +0200, Wolf Wiegand wrote:
> > > Florian (flobee) wrote:
> > >
> > > > Ich suche nach einem Befehl für ein shellscript (bash) was in
> > > > etwas das
> > > > gleiche macht wie "pause" unter der windows konsole.
> >
> > > Suchst Du read?
> > > echo Press Enter to continue
> > > read
> > > ...
> > >
> > > Da reicht leider kein Tastendruck, sondern es muss <enter>
> > > gedrückt
> > > werden.
> >
> > read -n1
> Yo, das scheint es zu sein.
> Leider schweigt meine "man" über parameter.
> Wo finde ich die informationen dazu?
> [...]
read ist ein Shell-builtin, meist mit Abwandlungen in
Bourne-Shell-Varianten vorhanden:
~:1> type read
read is a shell builtin
~:1> help read
read: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n
nchars] [-d delim] [name ...]
One line is read from the standard input, or from file descriptor FD if
the
-u option is supplied, and the first word is assigned to the first NAME,
the second word to the second NAME, and so on, with leftover words
assigned
to the last NAME. Only the characters found in $IFS are recognized as
word
delimiters. If no NAMEs are supplied, the line read is stored in the
REPLY
variable. If the -r option is given, this signifies `raw' input, and
backslash escaping is disabled. The -d option causes read to continue
until the first character of DELIM is read, rather than newline. If the
-p
option is supplied, the string PROMPT is output without a trailing
newline
before attempting to read. If -a is supplied, the words read are
assigned
to sequential indices of ARRAY, starting at zero. If -e is supplied and
the shell is interactive, readline is used to obtain the line. If -n is
supplied with a non-zero NCHARS argument, read returns after NCHARS
characters have been read. The -s option causes input coming from a
terminal to not be echoed.
The -t option causes read to time out and return failure if a complete
line
of input is not read within TIMEOUT seconds. If the TMOUT variable is
set,
its value is the default timeout. The return code is zero, unless
end-of-file
is encountered, read times out, or an invalid file descriptor is
supplied as
the argument to -u.
readonly: readonly [-af] [name[=value] ...] or readonly -p
The given NAMEs are marked readonly and the values of these NAMEs may
not be changed by subsequent assignment. If the -f option is given,
then functions corresponding to the NAMEs are so marked. If no
arguments are given, or if `-p' is given, a list of all readonly names
is printed. The `-a' option means to treat each NAME as
an array variable. An argument of `--' disables further option
processing.
Hth -- Peter
--
Peter.Weiss@consol.de ConSol* Software GmbH
Phone +49 89 45841-100 Consulting & Solutions
Mobile +49 177 6040121 Franziskanerstr. 38
http://www.consol.de D-81669 München
Reply to: