Traverse directory where all files are directories or files for file in. /* do if test-f $file then echo $file is the file fi if test-d $file then echo $file is the directory FidoneFilelist= 'ls./Proto 'Echo$filelist
The date command is the command that displays the DateTimeDateFriday, January 01, 2016 15:05:01 CSTThe option to modify the time is-s" 2016-01-01 12:56:10 "View CalendarAa.Annual CalendarCal-yTime to synchronize the serverYum Install Ntp-yNtpdate
Monitoring ideas, Architecture introductionRequirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program,
Create a simple shell script filePlacing the shell command in a text file requires first using a text editor (VIM)When you create a shell script file, you must specify the shell (#!/bin/bash) to be used in the first line of the fileThe format is:
(I am participating in the 2015 blog Star Selection, invite you to vote, thank you: HTTP://VOTE.BLOG.CSDN.NET/BLOGSTAR2015/CANDIDATE?USERNAME=ZHOUZXI)Recently, in the process of development work, a requirement was encountered: A shell script was
Bash is currently a more popular type of shell under Linux, and the following are some of the scattered things that are recorded in the learning process. Tidy up for forgetting!1. Transfer of function parameters1) Variables in the script that
$: script name, which is the script name entered by the command line$n: Positional parameters, n>0, when n>9, using ${n} form$#: Number of positional parameters"$*": All Positional parameters (single string)[Email protected]: All positional
Objective
Online collection, thank the old boy and the big God, often read their blog and video, script is absolutely their own pure hand, what shortcomings, but also please the Great God guidance. If you feel that there is a violation of the
# make direcory for backset file and scripts file,in my Case/backup/db_bakCd/backup/db_bakmkdir Scripts Logs Rman# The following is contents of Rman_backup_shVi/backup/db_bak/scripts/rman_backup_sh#!/bin/bash# author:anbob.com# Desc:rman Backup
1. Judging the format1) Test parameter fileExample: Test-e/root/install.log2) [parameter file]--Recommended useExample: [-e/root/install.log]Note: Spaces are required after and before the brackets2. determine file type parameters1)-D file: Determine
Positional variables:$: Gets the file name of the current execution shell, including the script path if the script is executed with a path $n: Gets the n=1..9 parameter value of the currently executing shell script, which represents the file
integer comparison-eq equals, as:if["$a"-eq"$b" ]-ne not equal to, such as:if["$a"-ne"$b" ]-GT greater than, as:if["$a"-gt"$b" ]-ge is greater than or equal to, such as:if["$a"-ge"$b" ]-lt less than, such as:if["$a"-lt"$b" ]-le less than equals,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service