I. Interface command interaction for shell scriptsecho "Please enter Css-dist:"Read Addcssecho "Start downloading the zip package for CSS"(wget $addcss) >>/dev/nullThe above is equivalent to:(wget http://****************-bin.zip) >>/dev/nullThe
Recently used a cluster HP1, because the maintenance of the cluster of people do not give force, the node always over a period of time dropped one or two. When Hadoop was restarted today, HDFs was in protected mode.decided to filter out all the
Give you a full, you in the Linux environment to try to understand more:The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number
First, the grammar Case inch " content of the first variable " # Each variable content is suggested in double quotation marks, the keyword is parentheses) # execution content ;; # Use two consecutive semicolons to handle each
Preface today just wrote an automated packaging script, again using the bash shell, a good feeling of happiness. The main point here is to introduce the Select command, which can help us to complete the menu selection function.Format I am also the
Linux shell scripting:1. Program Structure Exercise: Write a script, given a positive integer, to calculate the sum of all digits of this number.For example, if the program is given input 123, it should return 1+2+3=6.2. Program Structure Exercise:
Script First (test example 1) #vi first.sh
1
#!/bin/bash
2
echo ' your is in first file '
q) Call another script file in the current script file? Method One: Use sourceScript second (test
The user log information needs to be counted, when the user behavior is analyzed, the shell can often easily take out a lot of data, and then put it in Excel.For example: The statistics log contains loadcustomprocess This address of access, by
First, the grammarSelect inch con1 con2 con3 # automatically lists Con1,con2,con3 's selection menu do #执行内容break # Select itself is a loop, Break is when you choose to jump out of the loop done Second, practice
Select + Case Emulation
IamlaosongWe often use the Sqlplus EMSSXJK/EMSSXJK The SQL statement is equivalent to the input in the Sqlplus program environment, so that the input content is sandwiched between two eof, can be long and short, EOF can also be replaced by any other
When executing a shell script, a "-bash:./killsession.sh:/bin/bash:bad interpreter:text file Busy" error message is encountered, as follows:[Email protected] bin]$./killsession.sh-bash:./killsession.sh:/bin/bash:bad interpreter:text file busyAt this
The C language implementation of the LS command under Linux (supports the-R parameter):#include #include #include #include #include #include #include void Do_ls (char *), void Do_stat (char *,char *); void Show_ File_info (char *,struct stat *,
The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is: while Command Do If True done The command finishes, control returns to the top of
Shell variables and shell Variables
Suppose we define a variable:File =/dir1/dir2/dir3/my.file.txt
You can replace $ {} with different values:$ {File # */}: Delete the first/and its left string: dir1/dir2/dir3/my.file.txt$ {File ### */}: Delete the
Shell condition judgment1. if condition judgment: if [condition]; then do something fi multiple conditions: & represents AND | represents OR multiple judgments: if [condition]; then do something elif [condition 2]; then // do something else // do
Shell acronyms and judgment symbols []1. The test command is used to detect the file type and compare values. Determine whether a file exists:
[work@www sh]$ test -e file.txt && echo "exist" || echo "not exist" not exist[work@www sh]$
Use shell commands to analyze statistics logs
When you need to collect user log information and analyze user behavior, you can use shell to conveniently retrieve a lot of data and place it in excel for statistics.
For example, for access with the
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