1. Trang chủ
  2. » Công Nghệ Thông Tin

Mastering Unix Shell Scripting phần 1 pps

71 202 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 71
Dung lượng 496,73 KB

Nội dung

[...]... Other Options to Consider Common Uses Modifications to Consider 18 7 18 7 18 7 18 8 18 8 18 9 18 9 19 0 19 0 19 1 19 1 19 1 19 2 19 2 19 2 19 3 19 4 19 4 19 7 19 8 203 203 208 208 212 212 213 213 214 214 215 216 216 218 223 228 248 248 248 Summary Chapter 9 249 Monitoring Processes and Applications Monitoring Local Processes Remote Monitoring with Secure Shell 2 51 252 254 Checking for Active Oracle Databases Checking If the... 98 10 3 10 3 11 0 11 3 11 8 12 8 13 0 14 3 14 3 14 3 14 4 Summary Chapter 6 14 4 Monitoring Paging and Swap Space Syntax 14 5 14 6 AIX lsps Command HP-UX swapinfo Command Linux free Command Solaris swap Command Creating the Shell Scripts AIX Paging Monitor HP-UX Swap Space Monitor Linux Swap Space Monitor Solaris Swap Space Monitor All-in-One Paging and Swap Space Monitor 14 6 14 7 14 8 14 8 14 9 14 9 15 5 16 0 16 4 16 9... 14 9 14 9 15 5 16 0 16 4 16 9 Other Options to Consider 17 6 Event Notification Log File Scheduled Monitoring 17 7 17 7 17 7 Summary Chapter 7 17 7 Monitoring System Load Syntax 17 9 18 0 Syntax for uptime AIX HP-UX Linux Solaris What Is the Common Denominator? Scripting an uptime Field Test Solution Syntax for iostat AIX HP-UX 18 0 18 0 18 1 18 2 18 3 18 3 18 4 18 6 18 6 18 6 Contents Linux Solaris What Is the Common Denominator?... Example 23 .1: Converting from Base 10 to Base 16 Example 23.2: Converting from Base 8 to Base 16 Example 23.3 Converting Base 10 to Octal Example 23.4 Converting Base 10 to Hexadecimal Scripting the Solution Base 2 (binary) to Base 16 (hexadecimal) Shell Script Base 10 (Decimal) to Base 16 (Hexadecimal) Shell Script 5 21 523 523 524 525 526 527 529 530 535 543 545 545 546 546 552 554 555 556 5 61 563 564... Add Logging of Unreachable Machines Create Two-Way Messanging 594 597 602 603 603 604 606 608 608 608 609 610 610 611 616 617 618 618 618 619 619 620 6 21 6 21 623 623 624 627 627 628 629 630 640 642 643 644 645 645 645 Summary 645 Appendix A What’s on the Web Site 647 Index 663 Introduction In Unix there are many ways to accomplish a given task Given a problem to solve, we may be able to get to a solution... Shell Script Commands Symbol Commands Variables Command-Line Arguments Shift Command Special Parameters $* and $@ 10 13 13 13 14 15 Special Parameter Definitions Double Quotes “, Forward Tics ‘, and Back Tics ` Math in a Shell Script Operators Built-in Mathematical Functions 15 16 17 17 18 ix x Contents File Permissions, suid and sgid Programs chmod Command Syntax for Each Purpose Running Commands on... Introduction xix Chapter 1 Scripting Quick Start and Review Case Sensitivity Unix Special Characters Shells Shell Scripts Functions A Function Has the Form Running a Shell Script 1 1 2 2 2 2 3 3 Declare the Shell in the Shell Script 3 Comments and Style in Shell Scripts Control Structures Using break, continue, exit, and return Here Document 4 6 9 9 Syntax for a Here Document 9 Shell Script Commands Symbol... 298 298 299 304 308 Other Options to Consider 315 SSA Disks Log Files Automated Execution Event Notification 315 316 316 316 Summary Chapter 12 Automated Hosts Pinging with Notification Syntax Creating the Shell Script Define the Variables Creating a Trap The Whole Shell Script 317 319 320 3 21 3 21 323 324 Contents Other Options to Consider $PINGLIST Variable Length Limit Problem Ping the /etc/hosts File... Shell Script A shell script can be executed in the following ways: ksh shell_ script_name will create a Korn shell and execute the shell_ script_name in the newly created Korn shell environment shell_ script_name will execute shell_ script_name if the execution bit is set on the file (see the man page on the chmod command) The script will execute in the shell that is declared on the first line of the shell. .. shell script If no shell is declared on the first line of the shell script, it will execute in the default shell, which is the user’s system-defined shell Executing in an unintended shell may result in a failure and give unpredictable results Declare the Shell in the Shell Script Declare the shell! If we want to have complete control over how a shell script is going to run and in which shell it is to execute, . Contents Linux 18 7 Solaris 18 7 What Is the Common Denominator? 18 7 Syntax for sar 18 8 AIX 18 8 HP-UX 18 9 Linux 18 9 Solaris 19 0 What Is the Common Denominator? 19 0 Syntax for vmstat 19 1 AIX 19 1 HP-UX 19 1 Linux. 17 9 Syntax 18 0 Syntax for uptime 18 0 AIX 18 0 HP-UX 18 1 Linux 18 2 Solaris 18 3 What Is the Common Denominator? 18 3 Scripting an uptime Field Test Solution 18 4 Syntax for iostat 18 6 AIX 18 6 HP-UX 18 6 xii. xix Chapter 1 Scripting Quick Start and Review 1 Case Sensitivity 1 Unix Special Characters 2 Shells 2 Shell Scripts 2 Functions 2 A Function Has the Form 3 Running a Shell Script 3 Declare the Shell

Ngày đăng: 14/08/2014, 16:20

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN