Linux shell programming Notes-Background execution command crontab__ block chain

The Backstage execution command, is puts the shell command to the system backstage to execute, does not display in the terminal, does not affect the user to continue to work in the terminal, even if the terminal closes the command also to

Linux Automatic backup shell (using full backup, incremental backup strategy) __linux

ZZ http://www.cnblogs.com/coffee_cn/archive/2010/03/26/1697038.html Set in Cron, perform every Monday 2 o'clock in the morning (full backup every Monday, incremental backup for the rest of the time) #vi backup.sh #!/bin/bash #

The shell extracts the file suffix name and determines whether it is a specific string

If the file is a. css file or a. js file, it is processed. File=$1 if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then Do something Fi Attention: 1> extract file suffix name: ${file##*.} # #是贪婪操作符, matching from left to right,

The shell script implements the monitoring of whether a process is running or not

Problem description A few days ago, a friend needs real-time monitoring of a Linux system under a process, when the program is running to continue to monitor, when the program is finished to the end of a word to the end, and do follow-up. Problem

LINUX SHELL parsing JSON format __linux

cas

LINUX SHELL parsing JSON format 1. Use tool JQ https://stedolan.github.io/jq/ Download version Linux version Jq-linux64 Ubuntu Direct sudo apt-get install JQ can be. 2. Parse JSON [Root@cas script]# cat Test.json {"Tasks": [{"id":

Shell for Learning

#!/bin/bash for_1 () { echo ' for 1 show item ' for var in item1 item2 ... itemn do Echo ${var}; Done } for_2 () { echo ' for 2 show 1~5 ' for loop in 1 2 3 4 5 do echo ' The value is: ${loop} '

Several common shell commands

How to implement the line content code to remove the file * * *:If you only want to see the first 5 lines of the file, you can use the Head command,such as: Head-5/etc/passwdIf you want to view the following 10 lines of the file, you can use the

Getting started with Shell programming Three: Process Control __ Programming

Unlike Java, PHP and other languages, the process control of SH is not NULL, such as: public class test{public static void Main (string[] args) { int a = ten; if (a > 5) { System.out.println ("A is greater than 5");

Ways to get the shell script to execute automatically

Redirect Method When the shell sees #!/bin/bash GDB Help Quit Eof Pipe mode The combination of the Echo, Sleep command, and pipe operator (|). #!/bin/bash (Echo ' root '; sleep 1; Echo ' root ') | passwd Modify the root user's

Read text file content line-by-row with Linux shell __linux

It's a lot better than writing code: ubuntu@vm-0-13-ubuntu:~$ cat a.txt gaga agagag agaga agagd xxx agadaa Agaoo yyy zzzz ubuntu@vm-0-13-ubuntu:~$ ubuntu@vm-0-13-ubuntu:~$ ubuntu@vm-0-13-ubuntu:~$ cat a.sh Cat A.txt | While read

Introduction to Shell arrays

Introduction to Shell arrays Time: 2008-01-23 10:57:33 Source: Linux Federation Collection collation Author: You can also use array variables in bash, which are assigned two types of values: (1) name = (value1 ...

Linux Shell programming __ block Chain

Shell Programming 1. Briefly The format for writing shell scripts using the vi text Editor is fixed, as follows: #!/bin/bash #comments The symbol in the first line #! tells the system that the program that is specified by the following path

Linux shell if conditional expression summary __linux

Overview: In Linux shell programming, there are many conditional expressions for comparison/judgment, and this article makes a brief summary of them. 1. String comparison! Take the anti-n str string STR is NOT NULL -Z str string str is NULL STR1 =

Script Automatic Login shell script (compact version)

Background: Work on a variety of online machine landing scripts, and some need to log into the board before landing on the machine, and some dynamic password, each input is very troublesome, the use of automated landing scripts to manage too

Impala-shell Import and Export data

Impala-shell Import and Export Parameter description: -q Query (--query=query) executes queries from the command line without entering Impala-shell -d default_db (--database=default_db) Specify database -b (--delimited) to format the

Bash Shell determines if there is a given element in the array

#判断数组中是否有给定元素 #参数: 1 arrays; 2 element #返回: Yes/no # Example: # Determine if there are elements in array Xrsh_array i3 # xrsh_array= (i1,i2,i3) # xrsh_tmp= ' echo ${xrsh_array[*]} ' # Xrsh_arrhasitem ' $XR Sh_tmp "" i3 "# returns YES # Note: The

Shell determines whether a string is a number

#!/bin/bash # # method 1 A=1234;echo "$a" | [-N "' Sed-n '/^[0-9][0-9]*$/p" "] && echo string A is numbers The first-n is the shell's test flag, and the subsequent string "' Sed-n '/^[0-9][0-9]*$/p '" is tested, and if not NULL,

Multi-conditional Process Control for Shell if

h=$ (date +%h) s=$ (date +%s) m=$ (date +%m) if [$h = = && $m = = && $s = = 10]] A. bash [] single and double brackets Basic elements:O [] Two symbols should be separated by a space aroundO There is a space between the internal operator and the

Several methods of self-increment (plus 1) of shell integer variables

#!/bin/shA=1 a=$ (($a + 1)) a=$[$a +1] A= ' expr $a + 1 ' Let a++ Let A+=1 ((a++)) Echo $a 1. Classical methodsLength= ' expr length + 1 '2. Bash only$ ((length++)) 1. i= ' expr $i + 1 ';2. Let i+=1;3. ((i++));4. i=$[$i +1];5. i=$ (($i + 1))

A shell command script every day

List of files and directoriesThe most basic form of the LS command displays files and directories under the Pro directoryThe table of contents and files will display color distinctions.If the terminal is not supported in color, you can add the-F

Total Pages: 541 1 .... 331 332 333 334 335 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.