When you extract or filter text from a file or command output, you can use regular expressions (R E), which are collections of special or not very special string patterns.
^ matches only the beginning of the line$ only match end of line* Only one
Reprinted from Jrckkyy final edit Zengzhaonong
Using shell variables in sed and awk----------------------------------------------x=mmSed ' s/ab/' $x '/g ' B.COrSed ' s/ab/' "$x" '/g ' B.CSed ' s/' "$val" '//' UrfileThe most recent process of
There are several main ways to do this:
echo "$str" |awk ' {print length ($)} 'Expr Length "$str"echo "$str" |wc-cBut the third one will be 1 more, maybe the terminator is counted.There are three ways to determine that a string is empty:If ["$str" =
Linux variables are roughly divided into four categories: User-defined variables, environment variables, positional parameter variables, predefined variables four categories, the most commonly used is the first three categories, where positional
Test can be understood to be the same as [], [[]] in logic and logic or at times, it can be split into multiple []
[Cmd-a cmd]
#!/bin/bash
a=23;
If [$a-gt 18-a $a-lt]
then
echo ' Young && handsome '
else
echo ' Just so ... "
fi
Let's take a look at the return value of the two functions to get the way:
#!/bin/bash
#函数返回值获取测试.
function fun_test ()
{
#在函数内部是不能有其他的任何一条打印语句.
Echo
}
val=$ (fun_test)
echo $val
Another one:
#!/bin/bash
#函数返回值获取测试.
function fun_test
1 PATH environment variable
2 Use of redirects
0 Callout Enter default keyboard input, you can use other content to redirect the correct output on the 1 standard output screen
2 error output &> redirect
all output
redirection symbols are:
> >>
2
Original:Http://blog.pureisle.net/archives/1352.html
The Shell provides a large number of basic operations that are useful in scripting. The Shell evaluates the arithmetic expression you provide, performs an operation expansion, and replaces an
The Java Execution Shell command has not been used before, and it is thought to be as convenient as C, and can be done with a system function. It's not that much of a problem today. There are two ways of executing shell commands in Java:
1. Use of
Paste:
http://blog.csdn.net/allenlinrui/article/details/7490206
With Crontab you can execute a shell script or a series of Linux commands at a specified time. For example, the system administrator schedules a backup task to run every day
Getting
echo Color output position parameter variable a predefined variable read accept script arguments enter declare source command
echo Color Output
I just found out today . Echo can also output a string with a color :
Echo-e "asdasd\e[1;32m ABCD \e[0m"
Gathen: 397706991, learning together
Conf/hive.xml
Specific shell code Download: http://download.csdn.net/detail/luo849278597/9490920
create table if not exists think_statistics (date_type_name string,date_name string,type int,type_ Name
First need to go to the System Management-> Management plug-in, select the Optional Plug-in tab, search and find SSH slaves plugin plugin, click Download installation
You may need to reboot the Jenkins after the installation is complete
You can
Just started contacting the mongdb shell. Here is a record of the learning process.
Open the shell in the console.
Linux Environment:/usr/local/mongo/bin/mongo
Window Environment: D:\mongodb\mongodb-win32-i386-2.0.6\bin>mongo
The basic section
Recently work required, wrote some shell scripts to do server one-click Package Update,
Traversing a folder with a for recursion contains spaces in the file name, which is treated as two files
Workaround: Modify the delimited IFS
#! /bin/bash
#!/bin/bash
db_ip=
Db_user=
Db_passwd=
Db_name=
a=98000000
function Addsql ()
{
Ine2=$1
Ine3=$2
#sql1 = "Update table name set list = ${ine2} where id= ${ine3};";
sql1= "Update table name set sex=0 where id= ${ine3};";
echo $sql 1
Mysql-u $DB
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