I just got started with Linux development and recently encountered the problem of calling shell scripts in Java. I found a method suitable for cainiao-level development, as described below:
Add # In the first line of the shell script to be run
Many people think that, like passwd and Su, Telnet cannot work automatically through pipelines and input redirection, but in fact Telnet supports input redirection. although, strictly speaking, shell scripts cannot enable telnet to enter the
I often see 1> & 2 similar statements in Linux shell scripts. What does this mean?
In fact, both of them are Linux file descriptors. in Linux
0 indicates standard input.
1 indicates standard output
2 indicates error output
Another special one
The format is as follows:
# Echo-e '\ 033 [background color; foreground color; action control M string \ 033 [# m'# Echo-e '\ e [background color; foreground color; action control M string \ e [# m'
# Foreground | Background: Color#----------------
Bibliography:Guide to shell script learning, compiled by o'reilly Taiwan by Arnold Robbins & Nelson H. F. Beebe, published by Mechanical Industry Press
P24:
By default, when a shell execution has an executable attribute"ProgramThe shell will
Xcode statisticsCodeIt is very simple to use shell commands. Open the terminal, enter your project directory, and execute the following code
Find.-Name "*. m"-or-name "*. H"-or-name "*. html"-or-name"*. C" | xargs WC-l
To collect statistics on
The company's network is too bad, syncCodeThe speed is only 15 kb/s !!!
I can't bear to go online and find a shell script:
#! /Bin/bash echo "====== start repo sync ====" repo sync while [$? = 1]; DO echo "===== sync failed, re-Sync
Recently, the customer has been engaged in projects. The customer is eager to see the results. The boss always forgets to buy a domain name. There is no way to register a free domain name through the peanut shell for configuration. Because the
In the Linux Shell environment, two regular expression rules are provided. One is the basic regular expression (BRE), and the other is the extended regular expression (ERE ).The syntax list of these two expressions is as follows. Note that, if meta
Sometimes in bash shell, we need to obtain user input information, such as user name and password. The password cannot be displayed... In the face of such requirements, the practical command read can be implemented.
Read-P "input your Username:"
Author: Wang Shanshan,Hua Qing vision embedded college lecturer.
I. Differences and usage between system variables, user variables, and environment variables in shell:
Shell has the following basic types of variables:
1) environment variables
I. Io Devices
Io is the source and destination of the index data, which are called standard input, standard output, and standard error output.
Programs do not have to worry about device issues, such as files, terminals, and tape drives.
By default,
Ninth cycle
Basic Syntax:
While command
Do
List
Done
Single Row format:
While command; do list; done
For example:
X = 0
While [$ X-LT 10]
Do
Echo $ x
X = $ x + 1
Done
While loops are most commonly used to check whether user input is obtained
Send mail using msmtp mutt Shell
1. Compile the software.
Software: http://sourceforge.net/projects/msmtp/files/msmtp/1.4.13/msmtp-1.4.13.tar.bz2/download
Tar jxvf msmtp-1.4.13.tar.bz2
./Configure -- prefix =/opt/msmtp
Make
Make install
2. Check
Example 1#! /Bin/shcase ${1 # *. Tar.} In bz2) tar jxvf $1; GZ) tar zxvf $1; *) echo "Wrong file type" esac$1 indicates the first command line parameter ${1 # *. Tar.} when running the script. It indicates that the first command line parameter is
A few days ago, when I needed to call the binary program in Java code, I found some information on the Internet and wrote something to record.
Android is also a Linux-based system, and can also run binary executable files. However, Android only
This article is reproduced in: http://blog.sina.com.cn/s/blog_674b5aae0100o2mn.html
BASH Shell has four arithmetic operations:1: Use expr external program
Addition r = 'expr 4 + 5'Echo $ RNote!
4 + 5 there must be gaps between the three
'Expr 4 + 5
1 installation error: install_failed_insufficient_storage
Solution:1. Connect the data cable to the computer and use the "disk drive" method.2. Go to the. android_secure directory under sdcard (use a third-party Resource Manager)3. Delete the smdl2
ShellSpecial characters in
Author:Zccst
ShellIn addition to interpreting programs as commands, it is also a high-level programming language. ExploitationShellThe programming language can compile programs with strong functions but simple
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