Когда вы устанавливаете новые программы в терминале, вы могли часто видеть появляющиеся информативные диалоговые блоки для обратной связи с вами. Типы диалоговых блоков различны: от диалогов да/нет до полей ввода, блоков паролей, чеклистов, меню и так далее. Преимущества использования таких дружественных к пользователю блоков очевидны, ведь они интуитивно направляют вас для ввода необходимой информации.
Когда вы пишите интерактивный шелл скрипт, вы на самом деле можете использовать такие диалоговые блоки для принятия ввода пользователя. Будучи предварительно установленной на всех современных дистрибутивах Linux, программа под названием whiptail может у процесс создания шелл скриптом диалоговых и информационных блоков в терминале наподобие тех, что графических интерфейсов, что кодируют Zenity или Xdialog для скриптов.
В этом уроке я опишу как с использованием whiptail создать дружественный пользователю диалоговые блоки в шел скрипте. Я также покажу Баш фрагменты кода различных диалоговых блоков, поддерживаемых в whiptail.
Объяснение:
Название файла myhtml.html
<html>
<head>
<title>Вариант 1</title>
</head>
<body>
<h2 style="text-align: center">"Тестовое задание"</h2>
<hr>
<hr>
<hr>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
<li>D</li>
<li>E</li>
</ul>
<table border="1">
<caption>Таблица</caption>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td></tr>
</table>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<a href="Тут полное путь к этому файлу + /myhtml.html">Скачать</a>
<a href="ссылка на страницу" target="_blank"><img src="https:// vuzopedia.ru/storage/app/uploads/public/602/667/061/602667061f1a3416415373.jpg" style="width:100%"></a>
</body>
</html>