{"id":307692,"date":"2020-07-29T21:00:29","date_gmt":"2020-07-29T21:00:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307692"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307692","title":{"rendered":"\u041a\u0440\u0430\u0441\u043d\u044b\u0435 \u0433\u043b\u0430\u0437\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/512354\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gu\/sb\/ek\/gusbekevfjtlba2ljb8yttbtrsa.png\"><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0433\u043b\u0430\u0437.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u0441\u0435 \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u041b\u0438\u043d\u0443\u043a\u0441\u0430 \u043d\u0430\u0432\u0435\u0440\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u0438 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0434\u0438\u0441\u0442\u0440\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f. \u041c\u043d\u0435 \u0442\u043e\u0436\u0435 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c. \u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fi\/ft\/ty\/fifttysaxmarznnpc3zdaat-4vk.png\"><\/p>\n<p>  \u0421\u043b\u043e\u0436\u043d\u043e \u00ab\u0442\u0432\u043e\u0440\u0438\u0442\u044c\u00bb \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u043a\u0443\u0440\u0441\u043e\u0440 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u043e \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0439 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0431\u0435\u0441\u0438\u0442 \u0447\u0435\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442. \u0418 \u0432\u043e\u0442 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0441\u043a\u0430\u0437\u0430\u043b \u0441\u0435\u0431\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mq\/v5\/m2\/mqv5m25ocpjxr9wbmzmekop8pba.png\"><\/p>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u043e\u043c\u0443 \u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430. \u0412\u0441\u0442\u0430\u043b \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438? \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e `PS1`.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/iw\/7d\/cp\/iw7dcpzfvd1hbhnkmuqb7_zceha.png\"><\/p>\n<p>  \u0414\u0430, \u043f\u0440\u044f\u043c\u043e \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f. \u041d\u043e \u043a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f? \u0414\u0430 \u0438 \u0431\u0435\u0437 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043a\u0430\u043a-\u0442\u043e \u043d\u0435\u0443\u044e\u0442\u043d\u043e \u0441\u0435\u0431\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0448\u044c, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0435\u0448\u044c \u0441\u0435\u0431\u0435 \u0432\u043e\u043f\u0440\u043e\u0441: \u00ab\u0413\u0434\u0435 \u044f?\u00bb \u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u0444\u0430\u0439\u043b <i>~\/.bashrc<\/i>, \u0432 \u043d\u0451\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 PS1, \u0430 \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e, \u044f \u0440\u0435\u0448\u0438\u043b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0435\u0451 \u043d\u0435 \u0412 \u0430 \u041d\u0410\u0414 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b <i>~\/.bashrc<\/i> \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">PS1='$PWD\\n# '<\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438, \u0435\u0441\u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0432\u043e\u0439\u043d\u044b\u0435, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>$PWD (\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u0430\u043f\u043a\u0438, \u0430\u043d\u0430\u043b\u043e\u0433 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 pwd)<\/i> \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435(\u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433) \u0438 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a-\/i5\/ly\/a-i5lyqdra1chdjqve4xuibti-0.png\"><\/p>\n<p>  \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430, \u043d\u043e \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438 \u0441\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0435\u0441\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <i>ls<\/i>. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c <s>\u043c\u0443\u0445 \u043e\u0442 \u043a\u043e\u0442\u043b\u0435\u0442<\/s> \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438 \u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. \u042f \u0440\u0435\u0448\u0438\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u00ab\u0440\u0430\u043c\u043a\u0438\u00bb \u0434\u043b\u044f <i>$PWD<\/i>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 &quot;-&quot;. \u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>$COLUMNS<\/i>. \u0410 \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 &quot;-&quot; \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <i>printf<\/i>:  <\/p>\n<pre><code class=\"bash\">printf -v line &quot;%${COLUMNS}s&quot;<\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>$line<\/i> \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442 \u0435\u0451 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438 \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 <i>$COLUMNS<\/i> \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043d\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0430 &quot;-&quot;, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0440\u044e\u043a:  <\/p>\n<pre><code class=\"bash\">line=${line\/\/ \/-} # \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u043d\u0430 -<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432 <i>~\/.bashrc<\/i>  <\/p>\n<pre><code class=\"bash\">printf -v line &quot;%${COLUMNS}s&quot; line=${line\/\/ \/-} PS1='\\n$line\\n$PWD\\n$line\\n# '<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xc\/x4\/r6\/xcx4r6iyifeqovl2woyxqyo4jkq.png\"><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043a\u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430, \u0440\u0430\u0437\u043c\u0435\u0440 \u00ab\u043b\u0438\u043d\u0438\u0439\u00bb \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0438 \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u043f\u0440\u043e\u043f\u0430\u0434\u0435\u0442:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eg\/yh\/vd\/egyhvdsln3omfyddgkhgp9g6js4.png\"><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>info<\/i> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0451 \u0432 PS1:  <\/p>\n<pre><code class=\"bash\">info () {     printf -v line &quot;%${COLUMNS}s&quot;     line=${line\/\/ \/-}     printf &quot;\\n$line\\n$PWD\\n$line\\n# &quot; } PS1='$(info)'<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u0435\u043b\u044c \u00ab\u0432\u0441\u0442\u0430\u0432\u043a\u0443\u00bb \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0430. \u0412\u0441\u0442\u0430\u0432\u043a\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440 \u043b\u0438\u043d\u0438\u0438(\u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \u0434\u043e\u043f. \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432):  <\/p>\n<pre><code class=\"bash\">info () {     name_lenght=&quot;{ $HOSTNAME }&quot;     name_lenght=${#name_lenght}     top_line_left=$[(COLUMNS-name_lenght)\/2]     top_line_right=$[COLUMNS-(top_line_left+name_lenght)]     printf -v top_line &quot;%${top_line_left}s{_S_${HOSTNAME}_S_}%${top_line_right}s&quot;     printf -v bot_line &quot;%${COLUMNS}s&quot;     bot_line=${bot_line\/\/ \/-}     top_line=${top_line\/\/ \/-}     top_line=${top_line\/\/_S_\/ }     printf &quot;\\n$top_line\\n$PWD\\n$bot_line\\n# &quot; } PS1='$(info)'<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ro\/up\/tz\/rouptzovfl1esxa7q_mlamwxvkq.png\"><\/p>\n<p>  \u042f \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u043b \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438 \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438, \u043d\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0432\u043e\u043a\u0440\u0443\u0433 <i>$HOSTNAME<\/i> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u044b &quot;_S_&quot; \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0431\u0435\u043b\u044b. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 &quot;-&quot;, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u0435\u043b\u044b. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u0440\u0430\u0441\u043e\u043a, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u0430\u043a\u0438\u0435 \u0446\u0432\u0435\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">RED='\\e[31m' # \u043a\u0440\u0430\u0441\u043d\u044b\u0439 GRN='\\e[32m' # \u0437\u0435\u043b\u0451\u043d\u044b\u0439 YLW='\\e[33m' # \u0436\u0451\u043b\u0442\u044b\u0439 BLU='\\e[34m' # \u0441\u0438\u043d\u0438\u0439 MGN='\\e[35m' # \u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439 DEF='\\e[0m'  # \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e BLD='\\e[1m'  # \u0436\u0438\u0440\u043d\u043e DIM='\\e[2m'  # \u0442\u0443\u0441\u043a\u043b\u043e<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0448 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"bash\">info () {     name_lenght=&quot;{ $HOSTNAME }&quot;     name_lenght=${#name_lenght}     top_line_left=$[(COLUMNS-name_lenght)\/2]     top_line_right=$[COLUMNS-(top_line_left+name_lenght)]     printf -v top_line &quot;%${top_line_left}s{_S_$DEF$BLD$HOSTNAME${DEF}_S_$GRN}%${top_line_right}s&quot;     printf -v bot_line &quot;%${COLUMNS}s&quot;     bot_line=$GRN${bot_line\/\/ \/-}$DEF     top_line=${top_line\/\/ \/-}     top_line=$GRN${top_line\/\/_S_\/ }$DEF     printf &quot;\\n$top_line\\n$BLD$BLU$PWD$DEF\\n$bot_line\\n# &quot; } PS1='$(info)'<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1g\/zx\/ih\/1gzxihs5l0ml42zy1-pqmsadttw.png\"><\/p>\n<p>  \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435, \u043f\u0440\u0430\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0443\u0441\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0442\u0430\u043c \u0434\u0430\u0442\u0443, \u0438 \u0432\u0440\u0435\u043c\u044f:  <\/p>\n<pre><code class=\"bash\">printf -v date &quot;%(%a %d %b %T)T&quot;<\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 <i>$PWD<\/i>, \u043a\u0430\u043a\u043e\u0435, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">center_space=$[COLUMNS-${#date}-${#PWD}] ((center_space&lt;0)) &amp;&amp; center_space=1 ... printf &quot;\\n$top_line\\n$BLD$BLU$PWD$DEF%${center_space}s$DIM$date\\n$bot_line\\n# &quot;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kf\/ps\/nh\/kfpsnhfmr9zgnbjhi5a65ikktu0.png\"><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0432\u043e\u0434 <i>git status<\/i> \u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 \u0441 <i>git<\/i> \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">    git_tst= git_clr=     [[ -d .git ]] &amp;&amp; {         git_tst=(GIT $(git status -sb))         git_tst=&quot;${git_tst[*]} &quot; # \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430         git_clr=(GIT $(git -c color.ui=always status -sb))         git_clr=&quot;${git_clr[*]} &quot; # \u0446\u0432\u0435\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430     }     ...     center_space=$[COLUMNS-${#date}-${#PWD}-${#git_tst}]     ...     printf &quot;\\n$top_line\\n$BLD$BLU$PWD$DEF%${center_space}s${git_clr[*]}$DIM$date\\n$bot_line\\n\\$ &quot;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/-u\/d1\/ss\/-ud1ssfinaszv-ldrcg3srlfbg0.png\"><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0447\u0442\u043e <i>git_clr<\/i> \u0438 <i>git_tst<\/i> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 <i>git status<\/i>. \u041d\u043e \u0433\u0434\u0435 \u0436\u0435 \u0433\u043b\u0430\u0437\u0430? \u0421\u0435\u0439\u0447\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0433\u043b\u0430\u0437\u0430 \u041e_\u043e, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0433\u043b\u0430\u0437:  <\/p>\n<pre><code class=\"bash\">eyes=(O o \u2218 \u25e6 \u2364 \u2365)<\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e:  <\/p>\n<pre><code class=\"bash\">en=${#eyes[@]}<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0442\u0430:  <\/p>\n<pre><code class=\"bash\">mouth='_'<\/code><\/pre>\n<p>  \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043c\u043e\u0440\u0434:  <\/p>\n<pre><code class=\"bash\">face () {     printf &quot;$YLW${eyes[$[RANDOM%en]]}$mouth${eyes[$[RANDOM%en]]}$DEF&quot; }<\/code><\/pre>\n<p>  \u0413\u043b\u0430\u0437\u0430 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043a\u0440\u0430\u044f\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0447\u0435\u0441\u0442\u044c \u0438\u0445 \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0435\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:  <\/p>\n<pre><code class=\"bash\">face_tst='O_o  o_O' ... center_space=$[COLUMNS-${#date}-${#PWD}-${#git_tst}-${#face_tst}] printf &quot;\\n$top_line\\n$(face) $BLD$BLU$PWD$DEF%${center_space}s$git_clr$DIM$date $(face)\\n$bot_line\\n\\$ &quot;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kq\/38\/v0\/kq38v0jhhvff5hwd1_asx9o-26y.png\"><\/p>\n<p>  \u041a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0433\u043b\u0430\u0437\u0430 \u043f\u043e\u043a\u0440\u0430\u0441\u043d\u0435\u0442\u044c? <s>\u0414\u043e\u043b\u0433\u043e \u0441\u0438\u0434\u0435\u0442\u044c \u0437\u0430 \u043a\u043e\u043c\u043f\u043e\u043c, \u043d\u0435 \u0441\u043f\u0430\u0442\u044c<\/s> \u041d\u0430 <a href=\"http:\/\/stackoverflow.com\" rel=\"nofollow\">stackoverflow.com<\/a> \u043c\u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 <a href=\"https:\/\/stackoverflow.com\/questions\/16715103\/bash-prompt-with-last-exit-code\/62175983#62175983\" rel=\"nofollow\">\u0432\u043e\u043f\u0440\u043e\u0441<\/a>, \u0430\u0432\u0442\u043e\u0440 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442: \u00ab\u043a\u0430\u043a \u043c\u0435\u043d\u044f\u0442\u044c \u0446\u0432\u0435\u0442 \u0432 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e?\u00bb \u042d\u0442\u043e \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u043e \u043c\u0435\u043d\u044f \u043d\u0430 \u0438\u0434\u0435\u044e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0433\u043b\u0430\u0437. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>info<\/i> \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">info () {     error=$?     ... }<\/code><\/pre>\n<p>  \u0418 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>face<\/i> \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <i>$error<\/i> \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u043b\u0430 \u0433\u043b\u0430\u0437\u0430 \u0432 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0438\u043b\u0438 \u0436\u0451\u043b\u0442\u044b\u0439:  <\/p>\n<pre><code class=\"bash\">face () {     [[ $error -gt 0 ]] &amp;&amp; ecolor=$RED || ecolor=$YLW     printf &quot;$ecolor${eyes[$[RANDOM%en]]}$YLW$mouth$ecolor${eyes[$[RANDOM%en]]}$DEF&quot; }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uc\/or\/se\/ucorse5avrby6b1gx6ff8jjrbuc.png\"><\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 <s>\u0443 \u043c\u0435\u043d\u044f<\/s> \u0433\u043b\u0430\u0437\u0430 \u043f\u043e\u043a\u0440\u0430\u0441\u043d\u0435\u043b\u0438, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043a\u043e\u0435-\u0447\u0442\u043e. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <i>$debian_chroot<\/i>:  <\/p>\n<pre><code class=\"bash\">[[ $debian_chroot ]] &amp;&amp; chrt=&quot;($debian_chroot)&quot; || chrt= ... name_lenght=&quot;{ $HOSTNAME$chrt }&quot; ... printf -v top_line &quot;%${top_line_left}s{_S_$DEF$BLD$HOSTNAME$chrt${DEF}_S_$GRN}%${top_line_right}s&quot;<\/code><\/pre>\n<p>  \u0418 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0442\u0435\u043a\u0441\u0442 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u043e\u043a\u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430:  <\/p>\n<pre><code class=\"bash\">PS1='$(info)'; case &quot;$TERM&quot; in xterm*|rxvt*) PS1=&quot;\\[\\e]0;$(face 1) \\w\\a\\]$PS1&quot;;; esac<\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043e\u0440\u0434\u0430 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433, \u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>face<\/i> \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0430 \u043c\u043e\u0440\u0434\u0443 \u0431\u0435\u0437 \u0446\u0432\u0435\u0442\u043e\u0432\u044b\u0445 \u043a\u043e\u0434\u043e\u0432, \u043e\u043d\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0431\u0443\u0442\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>face<\/i> \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab1\u00bb), \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d 1-\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0432\u044b\u0434\u0430\u0442\u044c \u043c\u043e\u0440\u0434\u0443 \u0431\u0435\u0437 \u0440\u0430\u0437\u0443\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">face () {     [[ $error -gt 0 ]] &amp;&amp; ecolor=$RED || ecolor=$YLW     [[ $1 ]] &amp;&amp; printf &quot;${eyes[$[RANDOM%en]]}$mouth${eyes[$[RANDOM%en]]}&quot; \\              || printf &quot;$ecolor${eyes[$[RANDOM%en]]}$YLW$mouth$ecolor${eyes[$[RANDOM%en]]}$DEF&quot; }<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a-\/k6\/bw\/a-k6bwswfljnnwatjpiyvaybl7q.png\"><\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:  <\/p>\n<pre><code class=\"bash\">RED='\\e[31m' # \u043a\u0440\u0430\u0441\u043d\u044b\u0439 GRN='\\e[32m' # \u0437\u0435\u043b\u0451\u043d\u044b\u0439 YLW='\\e[33m' # \u0436\u0451\u043b\u0442\u044b\u0439 BLU='\\e[34m' # \u0441\u0438\u043d\u0438\u0439 MGN='\\e[35m' # \u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439 DEF='\\e[0m'  # \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e BLD='\\e[1m'  # \u0436\u0438\u0440\u043d\u043e DIM='\\e[2m'  # \u0442\u0443\u0441\u043a\u043b\u043e eyes=(O o \u2218 \u25e6 \u2364 \u2365) en=${#eyes[@]} mouth='_' face () {     [[ $error -gt 0 ]] &amp;&amp; ecolor=$RED || ecolor=$YLW     [[ $1 ]] &amp;&amp; printf &quot;${eyes[$[RANDOM%en]]}$mouth${eyes[$[RANDOM%en]]}&quot; \\              || printf &quot;$ecolor${eyes[$[RANDOM%en]]}$YLW$mouth$ecolor${eyes[$[RANDOM%en]]}$DEF&quot; } info () { error=$? git_tst= git_clr=     [[ -d .git ]] &amp;&amp; {         git_tst=(GIT $(git status -sb))         git_tst=&quot;${git_tst[*]} &quot; # \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430         git_clr=(GIT $(git -c color.ui=always status -sb))         git_clr=&quot;${git_clr[*]} &quot; # \u0446\u0432\u0435\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430     }     [[ $debian_chroot ]] &amp;&amp; chrt=&quot;($debian_chroot)&quot; || chrt=     name_lenght=&quot;{ $HOSTNAME$chrt }&quot;     name_lenght=${#name_lenght}     face_tst='O_o  o_O'     top_line_left=$[(COLUMNS-name_lenght)\/2]     top_line_right=$[COLUMNS-(top_line_left+name_lenght)]     printf -v top_line &quot;%${top_line_left}s{_S_$DEF$BLD$HOSTNAME$chrt${DEF}_S_$GRN}%${top_line_right}s&quot;     printf -v bot_line &quot;%${COLUMNS}s&quot;     printf -v date  &quot;%(%a %d %b %T)T&quot;     top_line=${top_line\/\/ \/-}     top_line=$GRN${top_line\/\/_S_\/ }$DEF     bot_line=$GRN${bot_line\/\/ \/-}$DEF     center_space=$[COLUMNS-${#date}-${#PWD}-${#git_tst}-${#face_tst}]     ((center_space&lt;0)) &amp;&amp; center_space=1     printf &quot;\\n$top_line\\n$(face) $BLD$BLU$PWD$DEF%${center_space}s$git_clr$DIM$date $(face)\\n$bot_line\\n\\$ &quot; } PS1='$(info)'; case &quot;$TERM&quot; in xterm*|rxvt*) PS1=&quot;\\[\\e]0;$(face 1) \\w\\a\\]$PS1&quot;;; esac<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435, \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!) \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c, \u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043b\u0430\u0439\u043a\u0438, \u0432\u043e\u0442 \u044d\u0442\u043e \u0432\u043e\u0442 \u0432\u0441\u0435, \u043f\u0440\u043e\u0435\u043a\u0442 \u0435\u0441\u0442\u044c \u0432 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 <a href=\"https:\/\/github.com\/vaniacer\/info-bar\" rel=\"nofollow\">info-bar<\/a> \u0422\u0432\u043e\u0440\u0438\u0442\u0435, \u0432\u044b\u0434\u0443\u043c\u044b\u0432\u0430\u0439\u0442\u0435, \u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435!)  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\u0412\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0438\u043c\u0432\u043e\u043b &quot;#&quot; \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u043d\u0430 &quot;$&quot;?)  <\/div>\n<\/p><\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/512354\/\"> https:\/\/habr.com\/ru\/post\/512354\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/512354\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gu\/sb\/ek\/gusbekevfjtlba2ljb8yttbtrsa.png\"><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0433\u043b\u0430\u0437.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-307692","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=307692"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307692\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}