Come da titolo, se ad esempio volglio reindirizzare da terminale un manuali nella mia home in formato .txt, il sistema non è in grado di visualizzarlo in modo correto.
Prendendo come esempio il :"man di alien" questo è il risultato:
Codice: Seleziona tutto
man alien > man_alien.txtCodice: Seleziona tutto
ALIEN(1) User Contributed Perl Documentation ALIEN(1)
NNAAMMEE
alien - Convert or install an alien binary package
SSYYNNOOPPSSIISS
alien [--to-deb] [--to-rpm] [--to-tgz] [--to-slp] [options] file [...]
DDEESSCCRRIIPPTTIIOONN
aalliieenn is a program that converts between Red Hat rpm, Debian deb,
Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want
to use a package from another linux distribution than the one you have
installed on your system, you can use aalliieenn to convert it to your
preferred package format and install it. It also supports LSB packages.
WWAARRNNIINNGG
aalliieenn should not be used to replace important system packages, like
init, libc, or other things that are essential for the functioning of
your system. Many of these packages are set up differently by the
different distributions, and packages from the different distributions
cannot be used interchangeably. In general, if you can't remove a
package without breaking your system, don't try to replace it with an
alien version.
PPAACCKKAAGGEE FFOORRMMAATT NNOOTTEESS
rpm For converting to and from rpm format the Red Hat Package Manager
must be installed...............
Codice: Seleziona tutto
#!/bin/sh
# Set the system locale. (no, we don't have a menu for this ;-)
# For a list of locales which are supported by this machine, type:
# locale -a
# en_US is the Slackware default locale:
#export LANG=en_US
export LANG=it_IT.utf8
# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968. These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#export LANG=C
# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly. In those cases, you can set LANG=C before
# starting them. Still, I'd avoid UTF unless you actually need it.
#export LANG=en_US.UTF-8
# Another option for en_US:
#export LANG=en_US.ISO8859-1
# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places. Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
export LC_COLLATE=C
# End of /etc/profile.d/lang.sh
Codice: Seleziona tutto
#!/bin/csh
# Set the system locale. (no, we don't have a menu for this ;-)
# For a list of locales which are supported by this machine, type:
# locale -a
# en_US is the Slackware default locale:
#setenv LANG en_US
setenv LANG it_IT.utf8
# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968. These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#setenv LANG C
# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly. In those cases, you can set LANG=C before
# starting them. Still, I'd avoid UTF unless you actually need it.
#setenv LANG en_US.UTF-8
# Another option for en_US:
#setenv LANG en_US.ISO8859-1
# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places. Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
setenv LC_COLLATE C
# End of /etc/profile.d/lang.csh
Codice: Seleziona tutto
function mantotext()
{
man --encoding=ascii $1 > file.txt
editor file.txt
rm file.txt
}
Prendendo come esempio il man di alien, mi basta aprire un terminale e dare:
Codice: Seleziona tutto
mantotext alienHo provato a fare la stessa, ho inserito lo script all'interno di ".bashrc " presente in ~/home di Slackware 13.1 ma non funziona per nulla, si limita ad aprire mousepad "IN BIANCO" non riporta nemmeno una riga del manuale.
-Qualcuno mi sa spiegare come dovrei fare per risolvere??
PS:E' mia consuetudine reidirizzare e salvare in una directori i manuali che più mi interessano, per averli sempre a portata di mano, lo trovo molto comodo, inoltre la mancata codifica potrebbe generare in futuro errori e problemi anche seri oltre ad inutili perdidte di tempo .
Grazie.

