1.Dd $Mdocdate: April 04 2020 $ 2.Dt INPUT 1 3.Os 4.Sh NAME 5.Nm input 6.Nd interactively prompt for user input 7.Sh SYNOPSIS 8.Nm input 9.Op Fl 110.Op Fl w11.Op Fl c Ar command12.Op Fl p Ar prompt13.Op Fl h Pa file14.Op Fl s Ar size15.Sh DESCRIPTION16The17.Nm18utility interactively prompts for input lines, writing received input to19standard output.20In demarcation to21.Xr read 122it provides23.Xr readline 324like line editing and an optional persistent history.25Besides, it continuously prompts for input instead of waiting for a26single input line.27.Pp28The options are as follows:29.Bl -tag -width Ds30.It Fl 131Read a single line from standard input and exit.32.It Fl w33Complete the last word instead of the entire line.34.It Fl c Ar command35Invoke36.Ar command37to retrieve a list of available completion items.38This command is invoked each time the user presses the tab character.39Items must be written to standard output and separated by a newline character.40.It Fl p Ar prompt41Change the default prompt string42.Qq "> "43to44.Ar prompt .45.It Fl h Pa file46Store the editing history in47.Pa file .48By default no editing history is kept.49.It Fl s Ar size50Specify the maximum editing history size.51By default 256 entries are kept.52.El53.Sh EXAMPLES54To write all input entered by the user to a file using a shell script:55.Bd -literal -offset indent56input | while read line; do57 echo "${input}" >> somefile.txt58done59.Ed60.Pp61To use62.Nm63as an alternative to64.Xr read 1 :65.Bd -literal -offset indent66name=$(input -1 -p "Enter your name: ")67printf "Hello %s!\n" "$name"68.Ed69.Sh SEE ALSO70.Xr rlwrap 1 ,71.Xr readline 372.Sh AUTHORS73.An Sören Tempel Aq Mt soeren@soeren-tempel.net