Есть ли дополнительные инструменты для команды info?

Я уже некоторое время использую man и знаю, что есть такие команды, как apropos или whatis, которые ссылаются на справочные страницы.

Но есть ли какой-либо эквивалент тезисов или какие-то дополнительные инструменты такого же рода для инструментов texinfo?

5
задан 10 June 2013 в 22:03

1 ответ

Насколько я знаю, не существует никаких дополнительных инструментов для команды info. Но если вы хотите что-то вроде whatis для man, вы можете создать свои собственные «инструменты». Например, вы можете создать некоторые функции оболочки (например, псевдоним):

about () { info $1 2>/dev/null | sed -n 6,8p; }

или, может быть, лучше:

inf () { info 2>/dev/null | grep "* $1:" | sed 's/ \+ /\t/g' | cut -f2; }

Некоторые выходные данные:

$ about () { info $1 2>/dev/null | sed -n 6,8p; }
$ #some outputs for 'about' function defined above
$ about ls
The `ls' program lists information about files (of any type, including
directories).  Options and file arguments can be intermixed
arbitrarily, as usual.
$ about cp
`cp' copies files (or, optionally, directories).  The copy is
completely independent of the original.  You can either copy one file to
another, or copy arbitrarily many files to a destination directory.
$ about yes
`yes' prints the command line arguments, separated by spaces and
followed by a newline, forever until it is killed.  If no arguments are
given, it prints `y' followed by a newline forever until killed.
$
$ inf () { info 2>/dev/null | grep "* $1:" | sed 's/ \+ /\t/g' | cut -f2; }
$ #some outputs for 'inf' function
$ inf ls
List directory contents.
$ inf cp
Copy files.
$ inf cut
Print selected parts of lines.
$ inf grep
Print lines matching a pattern.
$ inf sed
Stream EDitor.
0
ответ дан 10 June 2013 в 22:03

Другие вопросы по тегам:

Похожие вопросы: