1. Basic Knowledge
CAT/etc/ShellCHSH/bin/tcshEmacs = Vi?PdkshZsh
B C KPID is 1 not 0
Home variables exists in passwd, And the last entry of passwd is sh.
PS-Ef svr4PS au for BSD/Linux ps
Echo $ statusEcho $?
EUID // can be changed, like
When processing text files, It is very common to iterate and traverse rows, words, and characters in the files. A simple loop is used for iteration, coupled with redirection from stdin or a file. This is the basic method to iterate rows, words, and
I wrote a shell script to modify the suffix and learned it with everyone.Below isSource code: The copy storage is myrename. Sh, which can be used in full accordance with the instructions.Here, I would like to remind beginners that single quotation
Http://hi.baidu.com/zxvb3000/blog/item/9ecd2b022d15490b4bfb5199.html
1. Test commandThe test command is used to check whether a condition is true. It can be used to test values, characters, and files,The test characters and corresponding functions
From: http://www.jb51.net/article/34323.htm
Note: The subscript of the array in Shell starts from 0 by default.
1. Place the string in an array to obtain its length.
Copy the Code as follows:#! /Bin/bashSTR = "a B -- n d"Array = ($ Str)Length =$ {#
Is_upper ()
# Is_upper
# Checks tosee if we have a string in upper case
# To Call: is_upper $1
{
# Check we have the right Params
If [$ #-ne 1]; then
Echo "is_upper: I need a string to test OK"
Return 1
Fi
# Use awk to check we have only
Finally, we will introduce the common loop in shell script design ). The so-called loop is a piece of code in the script that is repeatedly executed under certain conditions.There are three types of commonly used loop in bash shell:** While*A For
I have been studying Linux for a week and a half. I wrote more than 20 shell scripts under the pressure of Marco Polo... Shell regular expressions, awk statements, program execution streams, test statements, sed statements, functions, and other
In the ps command, % CPU refers to the percentage of CPU usage time of a process. What does it mean? The man manual of PS is explained as follows:
CPU utilization of the Process in "##.. #" format. Currently, it is the CPU time used divided by the
This article is based on the following English documents: http://www.adminschoice.com/docs/crontab.htm.
Cron is a UNIX tool that uses cron background processes to automatically execute tasks at a specific time in the future. These tasks are usually
Today's group asked a question:Echo 123 | md5sumBa1f2511fc30423bdbb183fe33f3dd0f-Php-R "Echo MD5 ('20140901 ');"202cb962ac59075b964b07152d234b70The MD5 values of the two are inconsistent, so there are many interesting solutions:1 MySQL
Standard InputThe standard input is the file descriptor 0. It is the command input. The default input is the keyboard, or file or other command output.
Standard outputThe standard output is the file descriptor. 1. It is the command output. The
Every programmer working on Unix/Linux may be good at shell script programming. However, the methods for solving problems vary, depending on the degree of professional knowledge, the types of commands used, and the way you view problems. For
The awk program allows calling shell commands and provides pipelines to solve the problem of data transmission between awk and the system. Therefore, awk is easy to use system resources. There are two main methods:
A. Syntax] awk output command |
From: http://bbs.chinaunix.net/viewthread.php? Tid = 445229
Quote: $ unset
$ [-N "$ A"] & ["$ A"-lt 100] | echo 'too big! '
Too big!
Why can we get the above results? Mark
Question 1010) & | what is the
1 shell script must have the read and executable (RX) permissions.
2. Differences in script execution methods:
1) Sh script_name or./script_name: execute in the sub-process (a new bash environment)
2) Source script_name: executed in the parent
Write a script to copy the folder.
Principle: first package the folder to be copied with tar, then copy the package, and then unpack the package.Receive two parameters. If the parameter is smaller than 2, an error is returned.If the target folder is
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.