shell scripting basics

Learn about shell scripting basics, we have the largest and most updated shell scripting basics information on alibabacloud.com

Linux Shell Scripting Learning Summary

makefile compiled files./configure--prefix=/usr/local/apache--with=/aa/cc--prefix Specify installation directory,--with specify dependent file directory2.make Compiling makefile FilesMake also needs to be installed, yum install Make,makec,makeg3.make InstallMake install copies the compiled files to the directory specified by--prefix, if not specified, is the current directoryLinux related directory file storage content:The bin is stored in a normal program and can be used by all usersBoot stora

Ubuntu Shell Scripting Coding issues

the default format for shell scripts written in Windows systems is DOS instead of UNIX, resulting in incorrect output results.Look at the format of the shell script and edit the shell script with VI. Then enter ": Set FF?" If the output end is "Fileformat=dos", you need to modify the format of the file// modify file format, open

Shell scripting Getting Started learning notes

enter a variable value to the variable name at the keyboardIf you read+ multiple variable names, separate the values of the input variables with a space.More useful Commands read-p "Please input xxxxx:" + variable nameThe scope of the The export variable name can declare a variable as a global variable (this variable can be used in a child shell)be able to export XX = xxx at the time of definitionUse the unset variable name to eliminateOperation of C

"Linux command line and Shell Scripting Encyclopedia" chapter III study notes

specified shell command V Start the VI editor with the current file . Repeat the previous command N Find in file the overflow matches the content of the specified expression ‘ Jumps to the first content that the specified expression matches to Ctrl+l Redraw the current scre

Copy the daily EXPDP export file of an Oracle database to a remote server using shell scripting

Tags: scripting shell OracleCopy the daily EXPDP export file of an Oracle database to a remote server using shell scriptingZhao Full Text Network name: GuestartWe have a production environment Oracle database, although the daily Rman backup, but also overwhelmed by the developer go out said to restore a few days before the table data into the production environme

QuickStart Shell Scripting (iv)

overwritten.Syntax for input redirection: directives Example: For example, we have a file Test.txt with 3 lines of content. We want to count his number of rows, which can be counted by executing commands: Wc-l Result output: 3Well, through the content of section four, we have mastered the basic use of the shell, can write some simple shell program, but there is a gap between the real coding, so we have to

The 15th chapter of the Linux command line and Shell Scripting Encyclopedia presents data

.2) read uses the IFS character to parse the text, and here we specify the IFS as a comma.Cat >> $outfile This includes an output append redirect (>>) and an input append redirect (>> appends the output of the cat command to the file specified by the $outfile variable.The input to the Cat command is not taken from standard input, but is redirected to the data stored in the script.The EOF symbol marks the beginning and end of the data appended to the file.Input file + run + Result:DescriptionSpe

The difference between the Shell scripting language and the compiled language

, The interpreter (interpreter) needs to read the source code that we wrote and convert it to the target (object), which is then run by the computer. Because each execution of the program is more than the compilation process, so efficiency has decreased.The advantage of using scripting languages is that they are mostly run at a higher level than the compiled language and can easily handle objects such as files and directories, and the disadvantage is

The difference between the Shell scripting language and the compiled language

, The interpreter (interpreter) needs to read the source code that we wrote and convert it to the target (object), which is then run by the computer. Because each execution of the program is more than the compilation process, so efficiency has decreased.The advantage of using scripting languages is that they are mostly run at a higher level than the compiled language and can easily handle objects such as files and directories, and the disadvantage is

Linux 15th day vim and Scripting basics

it into a string$# number of parameters after output script[email protected] references all parameters after the script, but one reference$? Output previous command execution status return codeNumeric operationsLet VAR=ARG1+-*/%ARG2var=[$a + $b]var=$ (($a + $b))var=$ (expr ar1 ar2 ...)Logical operations | | Or! Non -Pstree Show Process TreeExport displays all of the current environment variablesUnset the variables that were set before the undoReadOnly setting read-only variablesDeclare-R Set re

Shell Scripting Tutorials

by default.The list of REDIRECT commands is as follows: Command Description Command > File Redirects the output to file. Command Redirects the input to file. Command >> file Redirects the output to file in an append manner. n > File redirect files with file descriptor N to file. n >> File Files with file descriptor n are redirected to file in an append manner.

Small Business SQL Server Data backup Shell scripting solution

"! -name "DB"! -name "rtx*" ' ">>/shell/bAckup.logElseecho "' Date +%y%m%d ' Delete unsuccessful" >>/shell/backup.logFi# from Email adminMail-s "DataBackup" [email protected] If [$WEEK-ne 0];thenif [!-d/hddf/database/' Date +%y%m%d '];thenMkdir-p/hddf/database/' Date +%y%m%d 'mv/hddf/database/{*.bak,*. BAK}/hddf/database/' Date +%y%m%d '/FiElseecho "Today is Sunday no data backup" >>/

Shell scripting Knowledge (i) basic knowledge preparation

parameter$n is the nth parameter"[Email protected]" was expanded to "$" "$" "$" and so on.10. Use the child shell to generate a separate processThe child shell itself is an independent process. You can use the () operator to define a child shell:Pwd(CD/BIN;LS)PwdWhen executed in a child shell, there is no effect on the current

Getting Started with Shell scripting--on

the exponentiation is ^ implementation arithmetic: (1) Let var= arithmetic expression (2) var=$[arithmetic expression] (3) VA r=$ (arithmetic expression)) (4) var=$ (expr arg1 arg2 arg3 ...) when multiplying to translate *, i.e. \* (5) declare–i var = value (6) echo ' Arithmetic expression ' | BcPractice:1. Write script/root/bin/sumid.sh, calculate the sum of the 10th user and 20th user ID in the/etc/passwd file [[email protected] bin] #vim sumid.sh #!/bin/bash u10= ' CA    T-n/etc/passwd |grep

Linux Shell + expect: Bulk SCP scripting Tools __linux

[Turn]http://www.knktc.com/2011/08/20/linux-shell-expect%e6%89%b9%e9%87%8fscp%e8%84%9a%e6%9c%ac%e5%b7%a5%e5%85%b7/ One of the most recent tasks in preparing a deployment is to send some files, such as installation packages, to a large number of servers. Although there is already a Brother Woo script available: A Python script written by the SSH and SCP features provided by the Paramiko module. But I'm still in the fear of Python (though I've worked m

Sch Help Shell Scripting encryption 02

Sch Help Shell Scripting Encryption Geneva I. Span style= "Word-wrap:break-word; Font-weight:normal; font-size:7pt; Font-family: ' Times New Roman ' ">NBSP;NBSP; introduction SHC (shell script compiler) shell script compiler. by SHC Compiled scripts are unreadable to ordinary users, so if you want your c

Shell Scripting Encryption

A goal is a dream with a deadline. Much effort, Much prosperity.Why Encrypt shell scripts? Of course it's for security!Maybe the script involves a password or something, and it needs to be encrypted.I. Download and install the SHC toolTo protect your own shell scripting program, there are many methods, the simplest way there are two: 1, encryption 2, set the expi

Unix Shell Scripting Programming Knowledge point

Scripting programming languages and compiled languages: Scripting programming Language: (Bash) The scripting language is usually interpreted (interpreted), which is read into the program code primarily by the interpreter (interpreter) and is translated into an internal form for execution. Advantages: can easily handle objects such as files and directories. D

Classic Shell Scripting issues

check if a string begins with the letter "abc"?[[$string = = abc*]][ [$string = = abc*]] and [[$string = = "abc*"]] What's the difference?[[$string = = abc*]]-Check whether the string starts with the letter ABC[[$string = = "abc"]]-check if the string is exactly equal to ABC54) How do I list user names that start with AB or XY?egrep "^ab|^xy"/etc/passwd|cut-d:-f1in bash) $! What does that mean?The PID of the recently executed command in the background.56) $? What does that mean?The end state of

Shell scripting, simple & Powerful

Head> 3 title>Test Python Web servertitle>4 Head>5 Body>6This is a test Python Web server,b>Hello!b>7 Body>8 HTML>View CodeHistory |awk ' {cmd[$ 2]++; count++;}END {for (a in CMD) print cmd[A] "" cmd[a]/count* "%" A} ' |Grep-v "./" |Column-c3-s ""-t |Sort-nr |NL | Head-n10 This line of script can output your most commonly used 10 commands, so you can even insight into what kind of programmer you are. Do you know the code? It doesn't matter, the system learns * nix

Total Pages: 15 1 .... 6 7 8 9 10 .... 15 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.