Bash, что такое команда, утилита, встроенный, как я различаю

Это работает:

Откройте терминал, затем введите

sudo add-apt-repository ppa:benkai/precise-unity-backport

sudo apt-get update

sudo apt-get remove unity-lens-applications

sudo apt-get install unity

wget http://ppa.launchpad.net/benkai/precise-unity-backport/ubuntu/pool/main/u/unity-lens-applications/unity-lens-applications_6.4.0-0ubuntu2_i386.deb

sudo dpkg -i unity-lens-applications_6.4.0-0ubuntu2_i386.deb

От: https://launchpad.net/~benkai/+archive/precise-unity-backport [ ! d2]

1
задан 4 January 2015 в 19:09

1 ответ

Некоторые встроенные команды включены для эффективности и существуют в качестве внешних команд в первую очередь. Например:

$ type -a echo
echo is a shell builtin
echo is /bin/echo

$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf

Подробный анализ встроенных и внешних команд можно найти в Unix & amp; Linux.

Что касается получения справки для двойных встроенных / внешних команд, таких как echo, у вас есть два варианта. Один из способов заключается в использовании man echo:

ECHO(1)                               User Commands                               ECHO(1)

NAME
       echo - display a line of text

SYNOPSIS
       echo [SHORT-OPTION]... [STRING]...
       echo LONG-OPTION

DESCRIPTION
       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)

       --help display this help and exit

       --version
              output version information and exit

       If -e is in effect, the following sequences are recognized:

       \\     backslash

       \a     alert (BEL)

 Manual page echo(1) line 1 (press h for help or q to quit)

И вы можете ввести:

$ help echo
echo: echo [-neE] [arg ...]
    Write arguments to the standard output.

    Display the ARGs, separated by a single space character and followed by a
    newline, on the standard output.

    Options:
      -n    do not append a newline
      -e    enable interpretation of the following backslash escapes
      -E    explicitly suppress interpretation of backslash escapes

    `echo' interprets the following backslash-escaped characters:
      \a    alert (bell)
      \b    backspace
      \c    suppress further output
      \e    escape character
      \E    escape character
      \f    form feed
      \n    new line
      \r    carriage return
      \t    horizontal tab
      \v    vertical tab
      \\    backslash
      \0nnn the character whose ASCII code is NNN (octal).  NNN can be
        0 to 3 octal digits
      \xHH  the eight-bit character whose value is HH (hexadecimal).  HH
        can be one or two hex digits

    Exit Status:
    Returns success unless a write error occurs.
2
ответ дан 24 May 2018 в 17:03

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

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