Andrew Hudson - Fedora™ Unleashed, 2008 edition

Здесь есть возможность читать онлайн «Andrew Hudson - Fedora™ Unleashed, 2008 edition» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Indianapolis, Год выпуска: 2008, ISBN: 2008, Издательство: Sams Publishing, Жанр: ОС и Сети, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Fedora™ Unleashed, 2008 edition: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Fedora™ Unleashed, 2008 edition»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Quick Glance Guide
Finding information you need is not always easy. This short index provides a list of common tasks discussed inside this book. Browse the table of contents or index for detailed listings and consult the specified chapter for in-depth discussions about each subject.
left How Do I…?
See…
How Do I…?
See…
left Back up my system?
Chapter 13
Partition a hard drive?
Appendix B, Chapters 1, 35
left Build a new Linux kernel?
Chapter 36
Play MP3s and other music?
Chapter 7
left Burn a CD?
Chapter 7
Print a file?
Chapter 8
left Change a password?
Chapter 4
Read a text file?
Chapter 4
left Change the date and time?
Chapter 32
Read or send email?
Chapter 21
left Compress a file?
Chapter 13
Read or post to newsgroups?
Chapter 5
left Configure a modem?
Chapter 2
Reboot Fedora?
Chapter 1
left Configure a printer?
Chapter 8
Rescue my system?
Chapter 13
left Configure a scanner?
Chapter 7
Set up a DNS server?
Chapter 23
left Configure a sound card?
Chapter 7
Set up a firewall?
Chapter 14
left Configure my desktop settings?
Chapter 3
Set up a web server?
Chapter 15
left Connect to the Internet?
Chapter 5
Set up an FTP server?
Chapter 20
left Control a network interface?
Chapter 14
Set up Samba with SWAT?
Chapter 19
left Copy files or directories?
Chapters 13, 32
Set up wireless networking?
Chapter 14
left Create a boot disk to boot Fedora?
Chapter 1
Shut down Fedora?
Chapter 1
left Create a database?
Chapter 16
Use a spreadsheet?
Chapter 6
left Create a user?
Chapter 4
Use Instant Messaging?
Chapter 5
left Delete a file or directory?
Chapter 32
Watch television on my computer?
Chapter 7
left Get images from a digital camera?
Chapter 7
Edit a text file?
Chapter 4
left Install Fedora?
Chapter 1
Make Fedora more secure?
Chapter 14
left Log in to Fedora?
Chapter 1
Mount a CD-ROM or hard drive?
Chapter 35

Fedora™ Unleashed, 2008 edition — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Fedora™ Unleashed, 2008 edition», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

TABLE 25.2 String Comparison Operators in Perl

Operator Meaning
eq Is equal to
lt Less than
gt Greater than
le Less than or equal to
ge Greater than or equal to
ne Not equal to
cmp Returns -1if less than, 0if equal, and 1if greater than
=~ Matched by regular expression
!~ Not matched by regular expression

Compound Operators

Perl uses compound operators, similar to those used by C or awk, which can be used to combine other operations (such as comparisons or arithmetic) into more complex forms of logic. Table 25.3 shows the compound pattern operators and their behavior.

TABLE 25.3 Compound Pattern Operators in Perl

Operator Meaning
&& Logical AND
|| Logical OR
! Logical NOT
() Parentheses; used to group compound statements

Arithmetic Operators

Perl supports a wide variety of math operations. Table 25.4 summarizes these operators.

TABLE 25.4 Perl Arithmetic Operators

Operator Purpose
x**y Raises xto the ypower (same as x^y)
x%y Calculates the remainder of x/y
x+y Adds xto y
x-y Subtracts yfrom x
x*y Multiplies xtimes y
x/y Divides xby y
-y Negates y(switches the sign of y); also known as the unary minus
++y Increments yby 1 and uses value (prefix increment)
y++ Uses value of yand then increments by 1 (postfix increment)
--y Decrements yby 1 and uses value (prefix decrement)
y-- Uses value of yand then decrements by 1 (postfix decrement)
x=y Assigns value of yto x. Perl also supports operator-assignment operators ( +=, -=, *=, /=, %=, **=, and others)

You can also use comparison operators (such as ==or <) and compound pattern operators ( &&, ||, and !) in arithmetic statements. They evaluate to the value 0for false and 1for true.

Other Operators

Perl supports a number of operators that don't fit any of the prior categories. Table 25.5 summarizes these operators.

TABLE 25.5 Other Perl Operators

Operator Purpose
~x Bitwise not(changes 0bits to 1and 1bits to 0)
x & y Bitwise and
x | y Bitwise or
x ^ y Bitwise exclusive or( XOR)
x << y Bitwise shift left (shifts xby ybits)
x >> y Bitwise shift right (shifts xby ybits)
x . y Concatenate yonto x
a x b Repeats string afor bnumber of times
x , y Comma operator — evaluates xand then y
x ? y : z Conditional expression — if xis true, yis evaluated; otherwise, zis evaluated.

Except for the comma operator and conditional expression, these operators can also be used with the assignment operator, similar to the way addition ( +) can be combined with assignment ( =), giving +=.

Special String Constants

Perl supports string constants that have special meaning or cannot be entered from the keyboard. Table 25.6 shows most of the constants supported by Perl.

TABLE 25.6 Perl Special String Constants

Expression Meaning
\\ The means of including a backslash
\a The alert or bell character
\b Backspace
\c Control character (like holding the Ctrl key down and pressing the C character)
\e Escape
\f Formfeed
\n Newline
\r Carriage return
\t Tab
\xNN Indicates that NN is a hexadecimal number
\0NNN Indicates that NNN is an octal (base 8) number

Conditional Statements

Perl offers two conditional statements, ifand unless, which function opposite one another. if enables you to execute a block of code only if certain conditions are met so that you can control the flow of logic through your program. Conversely, unlessperforms the statements when certain conditions are not met. The following sections explain and demonstrate how to use these conditional statements when writing scripts for Linux.

if/else

The syntax of the Perl if/elsestructure is as follows:

if ( condition ) {

statement or block of code

} elsif ( condition ) {

statement or block of code

} else {

statement or block of code

}

condition can be a statement that returns a true or false value.

Truth is defined in Perl in a way that might be unfamiliar to you, so be careful. Every thing in Perl is true except 0(the digit zero), "0"(the string containing the number 0), ""(the empty string), and an undefined value. Note that even the string "00"is a true value because it is not one of the four false cases.

The statement or block of code is executed if the test condition returns a true value. For example, Listing 25.3 uses the if/elsestructure and shows conditional statements using the eqstring comparison operator.

LISTING 25.3 if/elsif/else

if ($favorite eq "chocolate") {

print "I like chocolate too.\n";

} elsif ($favorite eq "spinach") {

print "Oh, I don't like spinach.\n";

} else {

print "Your favorite food is $favorite.\n";

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Fedora™ Unleashed, 2008 edition»

Представляем Вашему вниманию похожие книги на «Fedora™ Unleashed, 2008 edition» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Fedora™ Unleashed, 2008 edition»

Обсуждение, отзывы о книге «Fedora™ Unleashed, 2008 edition» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x