first time blogging to share some recent work imagenet Introduction
Imagenet is currently the world's largest image recognition of the database, the database contains a large number of image information, and these images have a basic tag information,
From the "Linnux program design," the second chapter, from one by one to knock out, the conclusion is that a few s did not come out effect
#。 /bin/sh and #. There's a difference,/bin/bash.
The first direct typing is the former, always output some-E,
Hbase is a distributed, column-oriented, open-source database that is built on Google's bigtable theory and based on the Hadoop HDFs file system. HBase differs from a generic relational database (RDBMS). is a database that is suitable for
In shell programming, it is often necessary to divide a string separated by a particular delimiter into an array, and in most cases we first think of using awkHowever, it is more convenient to actually use the shell's own split array function. IfA= "
You can't write this in Sh/bash, and if the Else branch doesn't have a statement execution, don't write this else.If ElseifIf statement syntax format:If conditionThenCommand1Command2...CommandNFiWrite a line (for the terminal command prompt):If [$
Through the shell script to configure the password-free login, divided into two scripts, one is the configuration file config.env, one is the formal script sshkey.sh.# config.envExport host_user=(root) export PASSWD=(a) export ssh_host= (192.168. 16
Tips Summary:String comparison with double brackets [[]]; arithmetic comparison with single brackets []--left and right spacesArithmetic operations with double parentheses (()); Shell commands and output parentheses ()--left and right without
1, there are two common ways to run a shell script:First give executable permission, then enter the directory where the file is located, enter:./name.sh;Run the interpreter and execute the script:/bin/sh name.sh, in which case there can be no #! in
If statement1, according to the file type to judge-d file) to determine if the file exists and is a character device file (the character device is true)-e file) to determine if the file exists (exists as true)[-e/root]echo $? The output is 0 #判断为真,
Functions: Code snippets that implement standalone functionalityfunction is only executed when calledSyntax One:function f_name{function body}Syntax Two:F_name () {function body}The return value of the function:Default function return value:
Shell Multi-Process basics
Code block: With {} as a whole
& function: Put the command in the background processing, idle out the current console for other operations
Wait command: Waits for the parent process to execute the
13 Basic IF statementsFormat 1:if condition; Then statement; FiExecution result is 5Format 2:if condition; Then statement; else statement; Fi#!/bin/basha=5if [ $a -gt 10 ];then echo $aelse echo 0fiExecution result is 0Format 3:if ...; Then ...; Elif
Prerequisite: Configure your own machine ssh password-free login#!/bin/bashCat list1234EODWhile Read lineDoif SSH [email protected] "test-f/tmp/a.sh"; Then #配置了免密登录, no password is entered hereecho "$line file exist."Elseecho "$line file not exist."
Shellgawkgawk Options
-f Specifies the field delimiter for delimited data fields in a row
-f Specifies the handler's script name
-V Var=value defining variables in the Gawk program
-MF N Specifies the maximum number of rows to
A shell function is a set of command sets or statements that make up an available block. Using functions can simplify scripting. The function requires that the function be defined and reused, and that it is used directly when calling the functions.
#!/bin/baship=$ (ifconfig eth0 |grep "inet addr" | awk ' {print $} ' |cut-f1-d ":") a=$ (df-h |grep/dev/sda2 |awk ' {print $} ' |cut-f1 -B "%") #截取分区使用率If [$a-ge] then echo "$IP the server root partition is about to have no space, please clean it up
1. Use the & symbol to execute commands in the backgroundYou can add the & symbol to the Linux command or script to make the command or script execute in the background, for example:.$./my-shell-script.sh &2. Use Nohup to execute commands in the
First, the basicView all shellsCat/etc/shells or Chsh–l1. Examples of scripts.Linux does not differentiate files, for the convenience of memory, here with. Sh end.(1) Vim first.sh#!/bin/bashMkdir/root/shellIfconfig(2) Add Execute permissions chmod
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