Using Options on the Command Line

Nasza ocena:

5
Wyświetleń: 406
Komentarze: 0
Notatek.pl

Pobierz ten dokument za darmo

Podgląd dokumentu
Using Options on the Command Line - strona 1 Using Options on the Command Line - strona 2

Fragment notatki:

Using Options on the Command Line
Program options specified on the command line follow these rules:
• Options are given after the command name.
• An option argument begins with one dash or two dashes, depending on whether it is a short form or
long form of the option name. Many options have both short and long forms. For example, -? and --
help are the short and long forms of the option that instructs a MySQL program to display its help
message.
Option names are case sensitive. -v and -V are both legal and have different meanings. (They are
the corresponding short forms of the --verbose and --version options.)
• Some options take a value following the option name. For example, -h localhost or --
host=localhost [221] indicate the MySQL server host to a client program. The option value tells
the program the name of the host where the MySQL server is running.
• For a long option that takes a value, separate the option name and the value by an “=” sign. For a
short option that takes a value, the option value can immediately follow the option letter, or there
can be a space between: -hlocalhost and -h localhost are equivalent. An exception to this
rule is the option for specifying your MySQL password. This option can be given in long form as --
password=pass_val [221] or as --password [221]. In the latter case (with no password value
given), the program prompts you for the password. The password option also may be given in short
form as -ppass_val or as -p. However, for the short form, if the password value is given, it must
follow the option letter with no intervening space. The reason for this is that if a space follows the
option letter, the program has no way to tell whether a following argument is supposed to be the
password value or some other kind of argument. Consequently, the following two commands have
two completely different meanings:
shell mysql -ptest
shell mysql -p test
The first command instructs mysql to use a password value of test, but specifies no default
database. The second instructs mysql to prompt for the password value and to use test as the
default database.
• Within option names, dash (“-”) and underscore (“_”) may be used interchangeably. For example, --
skip-grant-tables [453] and --skip_grant_tables [453] are equivalent. (However, the
leading dashes cannot be given as underscores.)
... zobacz całą notatkę

Komentarze użytkowników (0)

Zaloguj się, aby dodać komentarz