The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and
1. Write Script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address,OS version, kernel version, CPU model, memory size, hard disk size.Analysis:Explain:This is a stack of commands, and it's easy to
1. Gets the return value of the Shell function call:#!/bin/sh info () { cat jlb.sh} res= ' info ' echo ' state: ' $?echo ' res: ' ${res}description : res='info' This behavior calls function info, inside the symbol ' is not a single argument,
Shell Loop: ForThe number of cycles is fixed=====================Shell:For variable name [in value list]DoLoop bodyDoneC Language:for (initial value; condition; step))DoLoop bodyDone=====================Shell loop: While untilThe number of cycles is
Http://blog.chinaunix.net/uid-14351756-id-2820651.html$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the
When you run the script, you need to change the color of the text to improve the readability of the standard output.The echo command and the printf command enable this functionality.Formatted output can be implemented using the printf command, which
Script Writing backgroundWhether it is a production environment, a test environment, or a development environment, it is often necessary to use the RM command to delete & batch files in some "important" directories. According to the philosophy of
Typically, as a deployment script for an application, the first task that starts is to create a dedicated (dedicated) user and user group for the current app. This script is very easy. Here is a sample of references:#!/bin/shuser=test_usergroup=test_
The following instance is used in the Centos6.5 64-bit operating systemOne, the regular copy fileA. Create the tomcatback.sh file in the/usr/local/wfjb_web_back directoryFile contents:#将tomcat中的应用wfjb_web copied to the/usr/local/wfjb_web_back/tomcat_
Shell script automatically adds black malicious attack IPSystem environment: Centos 6.5 X64If we open the SSH 22 port to all the users, then we can see in the/var/log/secure file, where the face is full of malicious attacks of IP, then how can we
Shell script automatically adds black malicious attack IPSystem environment: Centos 6.5 X64If we open the SSH 22 port to all the users, then we can see in the/var/log/secure file, where the face is full of malicious attacks of IP, then how can we
This article focuses on the parts of the bash script that are prone to errors and rarely used but have unexpected effects.Cycle:Normal for loop: for inch a B C 1 2 3 do Echo " $i " DoneNumber sequence loop: for in 'seq-do- echo'$i'done The '
The scene of the problem is probably1 Cron calls a Python script2 python script calls a shell script (for log parsing) to get the shell output and then send the messageSimilar to a monitoring task.There is no problem running the Python script
Before learning the crontab command, do you see any of the following scenarios:(1) The test server will generate a lot of junk files every day, manual daily to clean up very cumbersome, how to let the system automatically clean up on time?(2) How to
1. Cron Service "Ubuntu environment"
2. Crontab usage
3. Edit the Crontab file
4. Process examples
5. Several examples
In Linux, periodic tasks are typically handled by the Cron daemon . Cron reads one or more configuration files that
The test command has three types of test expressions, the first of which is the comparison of numeric values, the second is the comparison of strings, and the third is the testing of files, such as testing the existence of a file.1. Numeric test ,
Summary: Chapter Three discusses the two basic operations that are commonly used when writing shell scripts. The fourth chapter introduces about 30 useful tools for processing text files.Chapter III Find and replaceSummary: This chapter discusses
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