Presumably, anyone who knows makefile knows that makefile can invoke a shell script. But when it's actually used, it's not that simple, and some ambiguous places can make you mad. If you don't believe it, you can take a look at a few examples,
Given A number, shows it in comma-separated form. expects DD and TD to is instantiated. Instantiates Nicenum. Or, if a second arg is specified, the output was echoed to stdout.
Nonsense not much to say that the first is
#!/bin/sh #
This is the 8th/101 script
There are as many ways to solve this quirky echo problem as There are the pages in this book. One of my favorites is very succinct:
function Echon
{
echo ' $* ' | awk ' {printf '%s ' $} '
}
You could prefer to
Script content: java_check.sh
#! /bin/bash
#
If [-Z ' pidof java ']; then
echo-e ' date +%y-%m-%d ' ' Date +%r '. "33[31m33[1m (JAVA) Process does not exist! 33[0m ">>/data/logs/java_check.log
/usr/local/tomcat/bin/startup.sh
Shuf-n5 Main.txt
Sort-r Main.txt | Head-5
awk-vn=5-vc= "' wc-l file '" ' Begin{srand () while (n
While read Line;do echo "$line $RANDOM";d One
Options for the Shuf command:
-E,--echo: treat each parameter as an input line-I,--input-range=lo-hi:
Special folder names are used to index the collection to retrieve the special folders that are required, and the following special folders are listed in the document:
For example, after more than one system, application installation, we often need to modify a lot of configuration files, with the VI editor means time-consuming, repetitive work, and SED can release us from the heavy duplication of work.
How SED is
Copy Code code as follows:
#!/bin/bash
ping= ' which ping '
Date= ' Date +%y%m%d%h%m '
Tail= ' which TAIL '
Log=./ping$date.log
hosts= "selboo.com.cn 221.130.191.97"
count=200
For MyHost in $HOSTS
Todo
count=$ (ping-c
For example, you might want to refer to the following implementation for a script that requires only sequential access to a resource, such as a disk file.
Copy Code code as follows:
#!/bin/bash
#
# File locking using Bash.
# ver 0.1.6
Shell string Comparisons, judging whether it's a number
Binary comparison operator, comparing variables or comparing numbers. Note the difference between numbers and strings.
Integer Comparisons
-eq equals, such as: if ["$a"-eq "$b"]
-ne is
Ctrl + a switches to command line start
Ctrl + e Switch to the end of the command line
Ctrl + L Clear Screen contents
Ctrl + U Clear the contents before the clipping cursor
Ctrl + K-cut to clear the contents after the cursor
Ctrl + y Copy the
One, the definition function
Copy Code code as follows:
function fname ()
{
statements;
}
Or
Copy Code code as follows:
FName ()
{
statements;
}
Second, call function
You can call a
Copy the files under the Bill folder to a certain rule (file name parity) under the Bill1,bill2 folder.Update BILL1,BILL2 Processing Progress tab (update File.max)File3 is the label for the current latest file in the bill directory and will normally
Because the Linux production environment to build a lot of steps, it is cumbersome and necessary steps. Although it has been done many times, but because of the cumbersome steps, it is easy to forget, the following small set up a time to build the
The following describes how to force users to change their passwords the next time they log on.
Each user account under Linux is associated with the various configuration and information associated with the password. For example, it remembers the
Here today we discuss a very funny system configuration error in Linux systems, which is sudo, and why it's funny, because if it's improperly configured, it's easy for the average user to claim root, and without a bit of technical content, System
First, Introduction
Environment variables are typically used to store path lists that are used to search for executables, library files, and so on. For example: $PATH, $LD _library_path, they usually look like this:
Copy Code code as follows:
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.