tailieunhanh - Mastering unix shell scripting p8

Nếu những điều kiện được đáp ứng sau đó bạn có thể chạy một phiên bản đơn giản của sqlplus trước, như trong Liệt kê 9,8, với sản lượng của các truy vấn, tuy nhiên, Oracle Listener là không được thử nghiệm như trong báo cáo sqlplus trước đó trong bảng liệt kê 9,7. Các lệnh sqlplus trong Ví dụ 9,8 nên được chạy trên các địa phương | 468 Chapter 18 set -n Uncomment to check syntax without ANY execution set -x Uncomment to debug this script SCRIPT_NAME basename 0 function usage echo n echo nUSAGE SCRIPT_NAME Number_Of_Meg_Bytes echo nEXAMPLE SCRIPT_NAME 5 echo n nWill Find Files Larger Than 5 Mb in and below echo the Current Directory. echo n n . echo n function trap_exit echo n echo n n EXITING ON A TRAPPED SIGNAL. echo n n n Set a trap to exit. REMEMBER - CANNOT TRAP ON kill -9 trap trap_exit exit 2 1 2 3 15 Check for the correct number of arguments if -ne 1 then usage exit 1 fi Check for an integer case 1 in Listing shell script listing. continued Finding Large Files 469 0-9 no-op -- Do Nothing usage exit 1 esac Check for an integer greater than zero if 1 -lt 1 then usage exit 1 fi Define and initialize files and variables here. THISHOST hostname Hostname of this machine DATESTAMP date h d Y T Date Time Stamp SEARCH_PATH pwd Top-level directory to search CURRENT DIR MEG_BYTES 1 Number of MB for file size trigger OUTFILE tmp Output user file cat dev null OUTFILE Initialize to a null file HOLDFILE tmp Temporary storage file cat dev null HOLDFILE Initialize to a null file Prepare the Output File Header echo nSearching for Files Larger Than MEG_BYTES Mb Starting in echo n SEARCH_PATH echo nPlease Standby for the Search Results. echo nLarge Files Search Results OUTFILE echo nHostname of Machine THISHOST OUTFILE echo nTop Level Directory of Search OUTFILE echo n SEARCH_PATH OUTFILE echo nDate Time of Search date OUTFILE echo nSearch Results Sorted by File Modification Time OUTFILE Listing shell script listing. continues 470 Chapter 18 Search for files MEG_BYTES starting at the SEARCH_PATH find SEARCH_PATH -type f -size MEG_BYTES 000000c -print HOLDFILE How many files were found if -s HOLDFILE File greater than zero bytes then NUMBER_OF_FILES cat HOLDFILE wc -1 echo nNumber of Files Found NUMBER_OF_FILES n n OUTFILE .

TỪ KHÓA LIÊN QUAN