⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialog.1

📁 This version of dialog, formerly known as cdialog is based on the Debian package for dialog 0.9a (se
💻 1
📖 第 1 页 / 共 2 页
字号:
...IP "\fB\-\-fselect \fIfilepath height width\fR"The file-selection dialog displays a text-entry window in which you can typea filename (or directory), and above that two windows with directorynames and filenames..IPHere\fBfilepath\fPcan be a filepath in which case the file and directory windowswill display the contents of the path and the text-entry window will containthe preselected filename..IPUse tab or arrow keys to move between the windows.Within the directory or filename windows, use the up/down arrow keysto scroll the current selection.Use the space-bar to copy the current selection into the text-entrywindow..IPTyping any printable characters switches focus to the text-entry window,entering that character as well as scrolling the directory and filenamewindows to the closest match..IPUse a carriage return or the "OK" button to accept the current valuein the text-entry window and exit..IPOn exit, the contents of the text-entry window are written to dialog's output....IP "\fB\-\-gauge \fItext height width [percent]\fR"A\fBgauge\fPbox displays a meter along the bottom of the box.The meter indicates the percentage.New percentages are read fromstandard input, one integer per line.The meter is updatedto reflect each new percentage.If the standard input reads the string "XXX",then subsequent lines up to another "XXX" are used for a new prompt.The gauge exits when EOF is reached on the standard input..IPThe \fIpercent\fR value denotes the initial percentage shown in the meter.If not specified, it is zero..IPOn exit, no text is written to dialog's output.The widget accepts no input, so the exit status is always OK....IP "\fB\-\-infobox \fItext height width"An \fBinfo\fP box is basically a \fBmessage\fP box.However, in this case, \fBdialog\fPwill exit immediately after displaying the message to the user.The screen is not cleared when \fBdialog\fPexits, so that the message will remain on the screen until the callingshell script clears it later.This is useful when you want to informthe user that some operations are carrying on that may require sometime to finish..IPOn exit, no text is written to dialog's output.Only an "Ok" button is provided for input,but an ESC exit status may be returned....IP "\fB\-\-inputbox \fItext height width [init]"An\fBinput\fPbox is useful when you want to ask questions thatrequire the user to input a string as the answer.If init is suppliedit is used to initialize the input string.When entering the string,the \fIbackspace\fP, \fIdelete\fP and cursor keyscan be used to correct typing errors.If the input string is longer thancan fit in the dialog box, the input field will be scrolled..IPOn exit, the input string will be printed on dialog's output....IP "\fB\-\-inputmenu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."An \fBinputmenu\fP box is very similar to an ordinary \fBmenu\fP box.There are only a few differences between them:.RS.TP 41.The entries are not automatically centered but left adjusted..TP2.An extra button (called \fIRename\fP) is implied to renamethe current item when it is pressed..TP3.It is possible to rename the current entry by pressing the\fIRename\fPbutton.Then dialog will write the following on dialog's output..IPRENAMED <tag> <item>.RE...IP "\fB\-\-menu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."As its name suggests, a\fBmenu\fPbox is a dialog box that can be used to present a list of choices inthe form of a menu for the user to choose.Choices are displayed in the order given.Each menu entry consists of a \fItag\fP string and an \fIitem\fP string.The \fItag\fPgives the entry a name to distinguish it from the other entries in themenu.The \fIitem\fP is a short description of the option that the entry represents.The user can move between the menu entries by pressing thecursor keys, the first letter of the \fItag\fPas a hot-key, or the number keys.IR 1-9 ". There are"\fImenu-height\fPentries displayed in the menu at one time, but the menu will bescrolled if there are more entries than that..IPOn exit the \fItag\fPof the chosen menu entry will be printed on dialog's output.If the \fB\-\-help-button\fR option is given, the corresponding helptext will be printed if the user selects the help button...IP "\fB\-\-msgbox \fItext height width"A \fBmessage\fP box is very similar to a \fByes/no\fP box.The only difference between a \fBmessage\fP box and a \fByes/no\fPbox is that a \fBmessage\fP box has only a single \fBOK\fP button.You can use this dialog box to display any message you like.After reading the message, the user can press the \fIENTER\fP key so that\fBdialog\fP will exit and the calling shell script can continue its operation..IPOn exit, no text is written to dialog's output.Only an "Ok" button is provided for input,but an ESC exit status may be returned...IP "\fB\-\-passwordbox \fItext height width [init]"A \fBpassword\fP box is similar to an input box,except that the text the user enters is not displayed.This is useful when prompting for passwords or othersensitive information.Be aware that if anything is passed in "init", itwill be visible in the system's process table to casual snoopers.Also, itis very confusing to the user to provide them with a default password theycannot see.For these reasons, using "init" is highly discouraged.See "\fB\-\-insecure\fP" if you do not care about your password..IPOn exit, the input string will be printed on dialog's output....IP "\fB\-\-radiolist \fItext height width list-height \fR [ \fItag item status \fR] \fI..."A\fBradiolist\fPbox is similar to a\fBmenu\fPbox.The only difference isthat you can indicate which entry is currently selected, by setting its.IR status " to " on ".".IPOn exit, the name of the selected item is written to dialog's output....IP "\fB\-\-tailbox file height width"Display text from a file in a dialog box, as in a "tail -f" command.Scroll left/right using vi-style 'h' and 'l', or arrow-keys.A '0' resets the scrolling..IPOn exit, no text is written to dialog's output.Only an "Ok" button is provided for input,but an ESC exit status may be returned....IP "\fB\-\-tailboxbg file height width"Display text from a file in a dialog box as a background task,as in a "tail -f &" command.Scroll left/right using vi-style 'h' and 'l', or arrow-keys.A '0' resets the scrolling..IPDialog treats the background task specially if there are otherwidgets (\fB\-\-and-widget\fP) on the screen concurrently.Until those widgets are closed (e.g., an "OK"),dialog will perform all of the tailboxbg widgets in the same process,polling for updates.You may use a tab to traverse between the widgets on the screen,and close them individually, e.g., by pressing \fIENTER\fP.Once the non-tailboxbg widgets are closed, dialog forks a copy of itselfinto the background, and prints its process id if the \fB\-\-no-kill\fP optionis given..IPOn exit, no text is written to dialog's output.Only an "EXIT" button is provided for input,but an ESC exit status may be returned..IPNOTE:Older versions of dialog forked immediately and attempted toupdate the screen individually.Besides being bad for performance,it was unworkable.Some older scripts may not work properly with the polled scheme....IP "\fB\-\-textbox file height width"A\fBtext\fPbox lets you display the contents of a text file in a dialog box.It is like a simple text file viewer.The user can move through the file by using thecursor, \fIPGUP/PGDN\fRand \fIHOME/END\fR keys available on most keyboards.If the lines are too long to be displayed in the box,the \fILEFT/RIGHT\fPkeys can be used to scroll the text region horizontally.You may also use vi-style keys h, j, k, l in place of the cursor keys,and B or N in place of the pageup/pagedown keys.Scroll up/down using vi-style 'k' and 'j', or arrow-keys.Scroll left/right using vi-style 'h' and 'l', or arrow-keys.A '0' resets the left/right scrolling.For more convenience,vi-style forward and backward searching functions are also provided..IPOn exit, no text is written to dialog's output.Only an "EXIT" button is provided for input,but an ESC exit status may be returned....IP "\fB\-\-timebox \fItext height [width hour minute second]"A dialog is displayed which allows you to select hour, minute and second.If the values for hour, minute or second are missing or negative,the current date's corresponding values are used.You can increment or decrement any of those using theleft-, up-, right- and down-arrows.Use tab or backtab to move between windows..IPOn exit, the result is printed in the form hour:minute:second....IP "\fB\-\-yesno \fItext height width"A \fByes/no\fP dialog box ofsize \fIheight\fP rows by \fIwidth\fP columns will be displayed.The string specified by\fItext\fPis displayed inside the dialog box.If this string is too long to fitin one line, it will be automatically divided into multiple lines atappropriate places.The\fItext\fPstring can also contain the sub-string.I"\en"or newline characters\fI`\en'\fPto control line breaking explicitly.This dialog box is useful forasking questions that require the user to answer either yes or no.The dialog box has a\fBYes\fPbutton and a\fBNo\fPbutton, in which the user can switch between by pressing the.IR TAB " key.".IPOn exit, no text is written to dialog's output.In addition to the "Yes" and "No" exit codes (see DIAGNOSTICS)an ESC exit status may be returned...\" ************************************************************************.SH "RUN-TIME CONFIGURATION".TP 41.Create a sample configuration file by typing:.LP.in +1i"dialog \-\-create-rc <file>".TP 42.At start,\fBdialog\fPdetermines the settings to use as follows:.RS.TP 4a)if environment variable\fBDIALOGRC\fPis set, its value determines the name of the configuration file..TP 4b)if the file in (a) is not found, use the file\fI$HOME/.dialogrc\fPas the configuration file..TP 4c)if the file in (b) is not found, try using the GLOBALRC file determined atcompile-time, i.e., \fI/etc/dialogrc\fP..TP 4d)if the file in (c) is not found, use compiled in defaults..RE.TP 43.Edit the sample configuration file and copy it to some place that\fBdialog\fPcan find, as stated in step 2 above...\" ************************************************************************.SH ENVIRONMENT.TP 15\fBDIALOGRC\fPDefine this variable if you want to specify the name of the configuration fileto use..TP 15\fBDIALOG_CANCEL\fP.TP 15\fBDIALOG_ERROR\fP.TP 15\fBDIALOG_ESC\fP.TP 15\fBDIALOG_EXTRA\fP.TP 15\fBDIALOG_HELP\fP.TP 15\fBDIALOG_OK\fPDefine any of these variables to change the exit code onCancel (1),error (-1),ESC (255),Extra (3),Help (2),or Ok (0).Normally shell scripts cannot distinguish between -1 and 255..TP 15\fBDIALOG_TTY\fPSet this variable to "1" to provide compatibility with older versionsof dialog which assumed that if the script redirects the standard output,that the "\fB\-\-stdout\fP" option was given..SH FILES.TP 20\fI$HOME/.dialogrc\fPdefault configuration file.SH EXAMPLESThe dialog sources contain several samplesof how to use the different box options and how they look.Just take a look into the directory \fBsamples/\fP of the source..SH DIAGNOSTICSExit status is subject to being overridden by environment variables.Normally they are:.TP 50if.BR dialog " is exited by pressing the " Yes " or " OKbutton..TP 51if the.BR No " or " Cancelbutton is pressed..TP 52if the.BR Helpbutton is pressed..TP 53if the.BR Extrabutton is pressed..TP 5-1if errors occur inside \fBdialog\fPor \fBdialog\fP is exited by pressing the \fIESC\fP key...\" ************************************************************************.SH BUGSPerhaps..SH AUTHORSavio Lam (lam836@cs.cuhk.hk) - version 0.3, "dialog".LPStuart Herbert (S.Herbert@sheffield.ac.uk) - patch for version 0.4.LPPako (demarco_p@abramo.it) - version 0.9a, "cdialog",.LPThomas Dickey (updates for 0.9b).SH CONTRIBUTORSTobias C. Rittweiler (tobrit@freebits.de)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -