Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txt can be replaced by ${} with different values: ${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/ }: Delete the last/ and its left string:
What I want to say here is a few shell parentheses, braces and parentheses, the use of commands, as follows:1.${var}2.$ (CMD)3. () and {}4.${var:-string},${var:+string},${var:=string},${var:?string}5.$ ((exp))6.$ (Var%pattern), $ (Var%%pattern), $
The difference between $ (()) in the shell and $ () and ${}Http://blog.chinaunix.net/uid-14351756-id-2820651.html$ () and ' (back quotes) in the bash shell, $ () and "(anti-quote) are used to do command substitution.The so-called command
First, on the prototype to save the method
It is perfectly possible to encode JavaScript without using prototype, for example:
function User (name, PasswordHash) {
this.name = name;
This.passwordhash = PasswordHash;
this.tostring =
Java+flexpaper+swftools Imitation Library document online reading
Reproduced from: http://my.oschina.net/stephenzou/blog/144489
I. The idea of online reading of documents1. Convert ppt, Word, Excel, text to PDF with OpenOffice2. Convert the
The example in this article describes the Golang method for implementing HTTP server processing static files. Share to everyone for your reference, specific as follows:
The new version is more streamlined:
Copy Code code as follows:
Accidentally yesterday, performed the RM xx-rf and removed a project. Then there are all kinds of remorse, all kinds of remorse, this project is a week's workload ah. Finally must solve, so Google search found the recovery artifact Extundelete, and
command Substitution
In Bash, $ () and ' (inverted quotes) are used for command substitution.The command substitution is similar to the variable substitution, which is used to reorganize the command line, complete the command line in the quotation
Accidentally yesterday, performed the RM xx-rf and removed a project. Then there are all kinds of remorse, all kinds of remorse, this project is a week's workload ah. Finally must solve, so Google search found the recovery artifact Extundelete, and
DescriptionI believe that in the work, many friends in the use of shell scripts encountered ${},%, #等这些字符的使用, and occasionally they will be dizzy, and then I use the following example to let everyone very well remember the Shell ${}, # #和 percent
Turn from:Linux shell ${} simple usageFor the sake of completeness, I'll use some examples here to illustrate some of the supernatural powers of ${}:Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtWe can replace each other with ${}
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt$
1. Determine the logged-on user1.1 Scripts[Email protected]_1 shell]$ VI check_user.sh#! /bin/shecho "You is logged in as ' WhoAmI '"; if [' whoami '! = Devtac]; Then echo "must is logged in as Devtac-to-run this script." Exitfiecho "Running
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtWe can replace each other with ${} to get different values:${file#*/}: Take out the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string:
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtWe can replace each other with ${} to get different values:${file#*/}: Take out the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string:
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt$
The following content is basically extracted from the Shell13 question.1. Truncation function${file#*/}: Take out the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string: my.file.txt${file#*.}: Take out
In the bash Shell , $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the fifth chapter, which is used to reorganize the command line:* Complete the
What is a shell script?A shell script is a text file that contains one or more commands.As a system administrator, we often need to use multiple commands to accomplish a task, and we can add these commands in a text file (shell script) to accomplish
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.