[Email protected] ~]# history # View command history, command history exists in ~/.bash_history file ~]# !! # Indicates the execution of the previous command ~]# ls!$ # represents the last parameter of the previous command ~]#!950
You want to use a shell script to convert all the images in a folder to a pixel.Here are some of the wrong places:1. When defining a variable, the variable name does not add a dollar sign ($), such as: VariableName="value" Note that there can be no
1. Judging by file type (common)-B To determine if the file exists-D to determine if it exists and whether it is a directory (the directory is true)-E to determine if the file exists (exists as true)-F to determine if the file exists and whether it
Getting Started with Shell programmingOne, variable assignment and arithmetic operationDemo Sample code:A=1echo $alet b= $a +1echo $bc =$[a+b]echo $cd =$[c*2]echo $dlet e=d*2echo $ef =$[e%5]echo $fNote the "=" number must not have spaces on either
First, what is the shellThe shell typically represents two levels of meaning, one is the command interpreter, such as bash, and the other is the shell script. In this section we stand on the command interpreter's point of view to illustrate the
Today, when you run the If judgment in the script, you always get into the corresponding branch and check the regular expression without errors. In the shell alone to execute or show no match. Rather strange, it was searched, it was found in the =~
The shell script resembles the following:
Bash or dash
The wording of a case statement
Script Help notation
The wording of whether the argument is empty
Parameters
#! /bin/Bash Case " $" inch-h|--help|?) Echo "usage:1
In order to locate the problem, we need to locate the running log or error message of the task.When some scripts are called through the shell, the log information is printed in the shell. However, there are users in the shell call normal, but to
This is a wonderful command.TR's whole spell is translate, that is, translation. Interestingly, we are able to make rules for translation. Use methods such as the following:TR [option] set1 [Set2]TR accepts input from standard input. The results are
use the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy, with the following name examples:[[email protected]]# ls/oldboyapquvdpqbk_oldboy.html
Video link:1. What is shell script (script written by Shell)1.1 Why study shell scripts? ()1.2 Writing and execution of the first script1.3 Creating a good habit of writing shell script2. Simple shell Script Exercise: (read-p date)3. Use the
The R-parameters of the LS command represent a recursive listing of all the files in all subdirectories, and 1 means that each row shows only one file or directory, and F means that the output is not sorted. F represents the end of each item's
A wildcard wildcard is a class of keyboard characters. Wildcards are often used in place of one or more real characters when looking for a folder, when you don't know the true character, or if you don't want to type the full name. *
One: RANDOMEcho $RANDOMRandom number is a range of 1--32767, generally used it can be cracked1.2 Generate a eight-digit random password:echo $ (($RANDOM +11111111))Two: Md5sum random encryption method generates a longer passwordTake 9-digit password:
Due to the need to manually install SBT for the first time, networking is required, so the network adapter mode of the virtual machine is set to "bridge mode" so that it can be connected to the Internet.However, when the "Spark-shell--master
Record the use of arrays in the shellThe main is the creation of elements, elements of the increment, delete, change operation.1#!/bin/Bash2 3 #基本数组操作4A= (1 2 3) # # () denotes an empty array5 Echo "a No. 0 element:"${a[0]}6 Echo "all elements:"${a[@
Variable: Stores the memory space of a single element:Array (multiple contiguous memory spaces): a contiguous memory space that stores multiple elements:Array Name:Index: Numbering starting from 0, is a numeric index;Note: Indexes can also support
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