Shell EOF Attention Point

We use this when sqlplus interacts with the shell.Su-oracle-c "Sqlplus/as sysdbaSELECT * from GV ($instance);ExitEOF "This program does not seem to be a problem, the actual execution of the time will be error.Why?Because in this way, something in

Calculations in the shell

Numerical calculation of variables in shell common commands(()), let, expr, BC, $[]One, (())Example:[[Email Protected]hell ~]# echo $ ((1+2)) 3Second, letExample:[[email protected] ~]# let a=1+2 [[email protected] ~]# echo $a 3Third,

Common judgments of shell scripts

-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if filename is writable,

Special symbols in the shell

The ":" in the shellActual case: A section of ===> in the HBase script# for releases, add HBase & WebApps to CLASSPATH# Webapps must come first else it messes up Jettyif [-D "$HBASE _home/hbase-webapps"]; ThenClasspath=${classpath}: $HBASE _homefiif

Calling each other between shell scripts

How do you invoke other shell scripts in the shell, or variables in other scripts, functions?method One:./subscript.SHmethod Two: source./subscript.SHNote:1. Two points, there are spaces, be careful.2. Two scripts are not in the same directory, use

Shell Condition judgment Parameters

-b file If it exists and is a block special file, True-c file If it exists and is a character special file, True-d file if it exists and is a directory, true-e file if it exists, it is true-f file If it exists and is a rule file, True-if the file

Writing shell Management Scripts (ii)

8.1 First Test "/etc/vsftpd", "/etc/hosts" is the directory, and through the "$?" Variable view returns a status value to determine the test result.[Email protected] ~]# [-D/ETC/VSFTPD][[email protected] ~]# echo $?0[Email protected] ~]#

Some of the shell script summaries that have been written

Automatically check for updates every night#!/bin/sh#auto gamedown2 versiondate= '/bin/date +%m%d ' count= ' curl ' Http://11.1.1.1/index.php?m=version&c=auto &a=zheng_count ' var= ' expr $COUNT/10 ' for ((i=1;i>/root/shell/auto/logs/$ Date.logdone0

Getting started with Linux Shell scripts

Linux shell script format#!/bin/sh#..... CommentsCommand...Command...Set permissions after creating with VI chmod +x filename.shExecute command:./filename.shLocal variables in the shellThe declaration of a variable, assignment, without a $ symbol,

1.2-shell variable

The variables are divided into 2 types: 1 system Variable 2: User-defined variableenv Display system variable set display system variables and user-defined variablesCustom variable rule: a=1 = number cannot have spaces on either sideCan only consist

1.2-shell Structure and execution

The shell is executed in sequence according to the script command.#!/bin/bash or #!/bin/sh /bin/sh is a soft link to/bin/bash# #描述信息ls/etc/echo "This is a test script"Wq save exit, file name test.sh not necessarily. Sh end, mainly for the sake of

1.4-shell Custom Variables

During script execution, if there are some commands or paths that are long and need to be used repeatedly. Variables are used instead, which makes it easy to change and maintain.Read-t3-p "Please input a number:" NEcho $nRead is commonly used to

2.0-shell Interrupt continues to exit

Several key words in the Shell control loop break continue exit#!/bin/bash#在1-loop in the 10 sequence, if the sequence equals 5, the number is not displayed and the loop is interrupted to continue with the successor task.For i in ' SEQ 1 10 'DoIf

Shell Getting Started example

For loop with 1 2 3 4 5do echo "The value is: $loop" (double quotes and no quotes are OK, single quotes do not work, output $loop) done results:The value is:1The value Is:2The value Is:3The value Is:4The value Is:5

The test of the shell face of ER

1. Write a shell procedure named Xunhuan (with a looping statement), as shown in the results of the operation.0102103210432105432106543210765432108765432102. Write a shell process called Cala, which functions as a small calculator that allows you to

Shell script: Functions

The Shell also supports functions. The shell function must be defined before use.Definition and invocation of a functionThe Shell functions are defined in the following format:Function_name () { List of commands [return value]}function return

Shell script: For

Similar to other programming languages, the shell supports A for loop.The general format for A for loop is: for inch List Do command1 command2 ... CommandN DoneA list is a sequence of values (numbers, strings, and so on), each separated

Shell script: string

Strings can be in single or double quotes, or without quotation marks.Single quotation marksstr='This isa string'Single-Quote String restrictions:1. Any character in a single quotation mark is output as is, and the variable in the single-quote

Shell script: Array

Bash supports one-dimensional arrays and does not qualify the size of the array, and the subscript of the array element is numbered starting with 0.Defining arraysIn the shell, the array is represented by parentheses, and the elements of the array

My Love topic shelling practice----compression shell Exercise three

Method One: Load OD, using ESP law:After the hardware access breakpoint, run four times, and run to fly, then we run three times, to see a lot of pop here:Retn returned and arrived at Oep: Method Two: Direct single-step tracking, tracking

Total Pages: 541 1 .... 471 472 473 474 475 .... 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.