First, what is the shellThe shell is both an executable program and a programming language. as an executing program, it interactively interprets and executes user-entered commands , and is a bridge between the user and the Unix/linux; as a
Basic steps:1. Switch to the warehouse directory Rpm_list_dir1 and RPM_LIST_DIR22. LS lists the RPM package files of the warehouse and redirects them to the output files Rpm_list_file1 and Rpm_list_file2 respectively.3. Output the comparison results
1, write script/root/bin/systeminfo.sh, display the current host system information, including host name, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size.#!/bin/bash# author:huiping# version:1.0.1# date:
The file name of the shell itself
$1~ $n Each parameter value added to the shell. $ $ is the 1th parameter, and the $ = is the 2nd parameter ...
$$ the shell itself PID (ProcessID)
$! PID of the Shell's last running background process
$?
What are positional variablesCalls the arguments passed to the script through the command line in the script code.What are the positional variables$1,$2,...: Corresponding to the 1th and 2nd parameters, Shift [n] position $: The command itself $*:
Brief description of single quotes, double quotes, and unquoted
Name
Explain
Single quotation marks
What you see is what you get: Everything inside a single quote is output as it is, or what you see in single
ObjectiveWhat the hell is a shell? Before this, we should understand the issue of file permissionsBody
Shell versionVarious versions:
Bourne Shell (SH), C Shell (CSH), and Korn Shell (Ksh)And at present:The common and CentOS default
The difference between one, ' and $ ()The anti-quote itself escapes the \, retains its own meaning, and if we want to play a special meaning in the anti-quote, we must use 2 \ to represent it. in inverted quotation marks: \ \ = \$ () in: \ = \Note:
From http://www.cnblogs.com/wang-li/p/5728461.htmlLinux ops shell script gadget, if you want to share this article, please indicate the source of the article, the following script is for reference only, if the error placed on the server, the
1. Condition testing: Test or [If the test result is true, the exit status of the command is 0, and if the test result is false, the exit status of the command is 0Operation Result:Test commands with and, or, not[ ! Expr]: Expr can be any of the
Condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical
the difference between the ' and $ ' ():In Bash, $ () and "(anti-quote) are used for command substitution.Command substitution is similar to variable substitution, which is used to reorganize the command line, complete the command line in quotation
IP independent IP in the specified time of the non-pass IPSquid Statistics method[Email protected] etc]# cut-d ""-f1/usr/local/squid/var/logs/access.log|sort|uniq|wc-l2823When you use awkawk ' {print '} ' |sort|uniq
Simple comprehension: Use many tools to simplify complex steps in a shell scriptFrame: Must have notes, written by others can understandBeginning: #! The/bin/bash means that the file is using bash syntaxTo use this method to run a shell script, if
1. Create an alias$ alias dms='cd oracle/middleware/user_projects/domains/7001_costctl/'pwd /home/weblogic/oracle/middleware/user_projects/domains/7001_costctlCreating an alias is only temporary, and once the alias for the terminal setting is turned
1. After installing Spark, enter spark in the bin directory: Bin/spark-shell scala> val textfile = Sc.textfile ("/users/admin/spark/ Spark-1.6.1-bin-hadoop2.6/readme.md ") scala> Textfile.flatmap (_.split (" ")). Filter (!_.isempty). Map ((_,1)).
ExplainRedirect: Is an action, an Operation action actionFile descriptors: Nouns, another representation of a file, Linux everything is file."Base redirection form"
Input redirect
Usage Rating: * *
The Shell's handling of the problem is simple, but most of the online search is done under Linux. As follows:
Sed-i ' s/[match string []/[Replace string]/g ' [filename]
And my system is MacOS, using this command has been unsuccessful, are
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