Shell Script Basics

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

How the shell generates RPM package warehouse list file comparison results

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

Basic job of Shell script

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 meaning of the shell script's own variable

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 $?

Shell position variables in a detailed

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 $*:

Shell Learning Note 1

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

12. Start the shell script

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

' and $ (), eval, crontab in the shell

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:

Shell script--Symbol Chapter

Shell Execution Script 650) this.width=650; "Width=" 799 "height=" 321 "title=" QQ picture 20160809205710.png "Style=" width:607px;height:229px;float : none; "alt=" Wkiom1ep0pkiz2v4aac1d9tdasu417.png "src=" http://s4.51cto.com/wyfs02/M02

<zz>linux OPS automation shell scripting gadget

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

Conditional testing and looping statements in the shell

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

Shell learns the next day

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

Anatomy of related commands in shell scripts

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 PV UV and corresponding statistics shell

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

Variables of Shell programming

Bash variables: User-defined variables, environment variables, positional parameter variables, predefined variablesUser-defined variables:#变量赋值等号两侧不能有空格#调用变量加 $ eg. Echo $x#变量的叠加: x= "$x" 456 or x=${x}789Set #查看变量Set-u #echo时看变量是否存在unset variable

A preliminary analysis of shell scripts

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

Shell Scripting Learning Summary--use of aliases

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

Spark Shell:wordcount Spark Primer

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)).

Shell redirection and file descriptors

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: * *

Replacing strings in files with "shell"macos system

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

Total Pages: 541 1 .... 308 309 310 311 312 .... 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.