<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Linux Forum &mdash; man bash]]></title>
	<link rel="self" href="https://linuxforum.ru/extern.php?action=feed&amp;tid=23053&amp;type=atom" />
	<updated>2012-09-07T15:33:05Z</updated>
	<generator>PunBB</generator>
	<id>https://linuxforum.ru/viewtopic.php?id=23053</id>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297524#p297524" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bormant пишет:</cite><blockquote><div class="quotebox"><cite>yars пишет:</cite><blockquote><p>Но работает же</p></blockquote></div><p>... если <span class="bbu">все</span> мануалы в utf8, локаль в utf8 и перекодировать не нужно. Но и мой рецепт выше в этом случае тоже работает. <br />А теперь слегка меняем условие: или мануал не в utf8, или пользователь сказал LANG=ru_RU.KOI8-R man ... (кстати, имеет полное право, может он по ssh зашёл и локаль его терминала как раз в KOI8-R).</p></blockquote></div><p>Да, это я и не учел. Но локально-то вполне можно применить?<br />UPD: </p><div class="quotebox"><cite>bormant пишет:</cite><blockquote><p>А теперь слегка меняем условие:</p></blockquote></div><p>А вот ваше решение как раз будет давать корректный результат в этом случае, да.<br />Так что, придется ждать и параллельно изучать Си <img src="https://linuxforum.ru/img/smilies/ac.gif" alt="ac" /></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-09-07T15:33:05Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297524#p297524</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297523#p297523" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yars пишет:</cite><blockquote><p>Но работает же</p></blockquote></div><p>... если <span class="bbu">все</span> мануалы в utf8, локаль в utf8 и перекодировать не нужно. Но и мой рецепт выше в этом случае тоже работает. <br />А теперь слегка меняем условие: или мануал не в utf8, или пользователь сказал LANG=ru_RU.KOI8-R man ... (кстати, имеет полное право, может он по ssh зашёл и локаль его терминала как раз в KOI8-R).</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-09-07T15:28:28Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297523#p297523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297521#p297521" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bormant пишет:</cite><blockquote><p>there is no magic solution, as the manuals are bundled without any mechanism allowing to each of them to declare the charset it uses.</p></blockquote></div><p>Блииин. Не заметил на радостях, там шрифт мелкий довольно. Но работает же. <img src="https://linuxforum.ru/img/smilies/ac.gif" alt="ac" /></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-09-07T15:22:20Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297521#p297521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297519#p297519" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yars пишет:</cite><blockquote><p>решает проблему перекодировки манов</p></blockquote></div><p>Увы и ах, но</p><div class="quotebox"><blockquote><p>there is no magic solution, as the manuals are bundled without any mechanism allowing to each of them to declare the charset it uses.</p></blockquote></div><br /><div class="quotebox"><cite>yars пишет:</cite><blockquote><p>а вот сообщения самой программы пока приходится побеждать по старинке</p></blockquote></div><p>Это решается намного проще, если дописать маленький патчик с использованием gettext (о локалях он умеет заботиться самостоятельно). Но это лишняя зависимость, две стороны одной медали... Хотя, если прилинковать статически <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-09-07T15:19:05Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297519#p297519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=297491#p297491" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bormant пишет:</cite><blockquote><p>Корень проблемы в том, что nroff (groff), используемый для форматирования страниц man, не умеет utf-8 как следует.</p></blockquote></div><p>В 14.0, похоже, это уйдет в прошлое <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /><br />Как и пишут на <a href="http://www.linuxquestions.org/questions/slackware-14/slackware-14-0-rc4-4175425014/page2.html#post4771244">LQ</a>, запуск</p><div class="codebox"><pre><code>GROFF_ENCODING=utf8 man что-то</code></pre></div><p> решает проблему перекодировки манов, а вот сообщения самой программы пока приходится побеждать по старинке <img src="https://linuxforum.ru/img/smilies/ab.gif" alt="ab" /></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-09-07T11:33:04Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=297491#p297491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284642#p284642" />
			<content type="html"><![CDATA[<p>Если допустить, что все русские страницы перекодированы в utf8, консоль в utf8, то можно использовать строчку NROFF:</p><div class="codebox"><pre><code>NROFF           /usr/bin/groff -mandoc -Dutf8 -Tutf8</code></pre></div><p>А если добавить enca для перекодирования входного &quot;чего угодно&quot; в utf8, может неплохо получиться ;-) Что-то вроде</p><div class="codebox"><pre><code>NROFF           /usr/bin/enconv -L ru -x utf8 | /usr/bin/groff -mandoc -Dutf8 -Tutf8</code></pre></div><br /><p>ps. Плата -- потеря универсальности, &quot;LANG=ru_RU.KOI8-R man нечто&quot; использовать уже не получится, ибо utf8 в этом варианте &quot;прибита гвоздиком&quot;.<br />pps. Но можно попробовать поправить nroff под свои нужды (добавив -Dutf8 для случая -Tutf8) или написать упрощённую замену.</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-06-28T07:15:04Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284642#p284642</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284640#p284640" />
			<content type="html"><![CDATA[<p>Ага. Спасибо еще раз, намек понял, буду разбираться.</p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-06-28T07:10:32Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284640#p284640</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284635#p284635" />
			<content type="html"><![CDATA[<p>То, как вызывается groff из nroff -- отдельная песня. Намекаю:</p><div class="codebox"><pre><code>$ which nroff
/usr/bin/nroff

$ file $(which nroff)
/usr/bin/nroff: POSIX shell script, ASCII text executable

$ less $(which nroff)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-06-28T06:58:40Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284635#p284635</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284634#p284634" />
			<content type="html"><![CDATA[<p>Ну да, спасибо, речь именно о символах списка (в данном случае). Но главное, я теперь знаю где смотреть, если что, и по мере того, как буду замечать подобные нестыковки, буду об этом рапортовать. Жаль, меня пока не хватает на что-то более серьезное, чем лазить по конфигам <img src="https://linuxforum.ru/img/smilies/ac.gif" alt="ac" /></p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-06-28T06:54:53Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284634#p284634</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284633#p284633" />
			<content type="html"><![CDATA[<p>Корень проблемы в том, что nroff (groff), используемый для форматирования страниц man, не умеет utf-8 как следует.<br />Поэтому, самым правильным решением является добавление соответствующей поддержки в nroff (groff). <br />Поскольку этого никто пока не сделал, приходится выполнять &quot;приседания&quot; по &quot;кормёжке&quot; nroff текстами в однобайтной кодировке. Если в этой кодировке отсутствует какой-то символ (например &quot;№&quot; в KOI8-R), то он потеряется. Это что касается самого текста страницы.</p><p>Что использовать в качестве символов списка -- тут нужно смотреть в сторону настроек nroff (groff). В исходнике страницы на месте списка:</p><div class="codebox"><pre><code>.SH &quot;RESTRICTED SHELL&quot;
.\&quot; rbash.1
.zY
.PP
If
.B bash
is started with the name
.BR rbash ,
or the
.B \-r
option is supplied at invocation,
the shell becomes restricted.
A restricted shell is used to
set up an environment more controlled than the standard shell.
It behaves identically to
.B bash
with the exception that the following are disallowed or not performed:
.IP \(bu
changing directories with \fBcd\fP
.IP \(bu
setting or unsetting the values of
.SM
.BR SHELL ,
.SM
.BR PATH ,
.SM
.BR ENV ,
or
.SM
.B BASH_ENV
.IP \(bu
specifying command names containing
.B /</code></pre></div><p>и т.д. Символы ненумерованного списка -- это команда &quot;.IP \(bu&quot; в исходнике страницы. В том виде, как оно есть, это символ с кодом \xB7. Если в качестве однобайтной будет использована кодировка, в которой \xB7 является символом ненумерованного списка (bullet), он будет успешно преобразован в него же, но в UTF-8. <br />Другой путь -- поискать в настройках nroff (groff) как заставить его выдавать вместо этого символа другой, например, дефис (минус).</p><p>ps. Или речь о каких-то других символах кроме символов списка?</p>]]></content>
			<author>
				<name><![CDATA[bormant]]></name>
				<uri>https://linuxforum.ru/profile.php?id=732</uri>
			</author>
			<updated>2012-06-28T06:38:09Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284633#p284633</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[man bash]]></title>
			<link rel="alternate" href="https://linuxforum.ru/viewtopic.php?pid=284610#p284610" />
			<content type="html"><![CDATA[<p>Доброго времени! Вот такая проблема: если пересобрать man согласно рецепту <strong>bormant</strong>&#039;a,&nbsp; то у меня получается следующее:<br /></p><div class="codebox"><pre><code>RESTRICTED SHELL
       If bash is started with the name rbash, or the -r option is supplied at invocation,  the  shell  becomes  restricted.   A
       restricted  shell  is  used  to set up an environment more controlled than the standard shell.  It behaves identically to
       bash with the exception that the following are disallowed or not performed:

             changing directories with cd

             setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV

             specifying command names containing /

             specifying a file name containing a / as an argument to the .  builtin command

             specifying a filename containing a slash as an argument to the -p option to the hash builtin command

             importing function definitions from the shell environment at startup

             parsing the value of SHELLOPTS from the shell environment at startup

             redirecting output using the &gt;, &gt;|, &lt;&gt;, &gt;&amp;, &amp;&gt;, and &gt;&gt; redirection operators

             using the exec builtin command to replace the shell with another command

             adding or deleting builtin commands with the -f and -d options to the enable builtin command

             using the enable builtin command to enable disabled shell builtins

             specifying the -p option to the command builtin command

             turning off restricted mode with set +r or set +o restricted.

       These restrictions are enforced after any startup files are read.

       When a command that is found to be a shell script is executed (see COMMAND EXECUTION above), rbash turns off any restric-
       tions in the shell spawned to execute the script.</code></pre></div><p>Как видите, несколько символов &quot;оно&quot; посчитало недопустимыми и удалило. Как бы это побороть? Я собирал версию из 12.1 (1.6f), имеет ли это значение? Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[yars]]></name>
				<uri>https://linuxforum.ru/profile.php?id=22799</uri>
			</author>
			<updated>2012-06-28T03:02:10Z</updated>
			<id>https://linuxforum.ru/viewtopic.php?pid=284610#p284610</id>
		</entry>
</feed>
