dual-Branch if statement: if judgment condition; then s Tatement1 ... else statement3.. Fi exit: Exit script file Test:-E file: Test files for existence-F file: Test file is normal FILE-D-File: Tests whether the files are directories-r file: The test file is readable- W File: Test whether the file is writable by the-X file: whether the test file can be executed bash-x test script stepping to see if there is a syntax error multi-branch if statement: Judging condition 1
, followed by a letter and any character of any length, in the/etc directory;Ls-d/etc/[^a-z][a-z]*Exercise 4: Copy all files or directories that start with M and that end with a non-digit to the/tmp/magedu.com directory, in the/etc directory;Cp-r/etc/m*[^0-9]/tmp/magedu.com/Exercise 5: Copy the/usr/share/man directory, all the files or directories that begin with man, followed by a number, to the/tmp/man/directory;Cp-r/usr/share/man/man[0-9]/tmp/man/Exercise 6: Copy all files or directories that
() method, which is the blocking method until all the threads reach the fence position, then the fence is opened and all the threads are freed, and the fence is reset for the next use.Another form of fence is exchanger, which is a two-party (two-party) fence in which the parties exchange data on the fence position. For example, when one thread wants to write data to a buffer, another thread reads the data from the buffer. These threads can use Exchanger to converge and swap the slow buffer with
blocking operation and a normal operation that takes a long time to execute is that the blocked thread must wait for a time that is not under its control to continue.The put and take methods of Blockingqueue throw a check exception (Checked Exception) interruptedexception, which is the same as other methods in the class library, such as Thread.Sleep. When a method throws When interruptedexception, it means that the method is a blocking method. When a method throws Interruptedexception, there ar
is generally assigned to a variable variable = setTimeout ("function", interval)Cleartimeout is canceling a function that is waiting to be executed, and this method requires a parameter: cleartimeout (variable)moveelement () function (see the original book for an explanation of the function, which works like jquery's animate)functionmoveelement (elementid,final_x,final_y,interval) {if(!document.getelementbyid)return false; if(!document.getelementbyid (ElementID))return false; varElem =document.
operator:First, the destructor of the vector is activated; The constructor activates the destructors for these elements (if they have destructors), and then releases the memory used by those elements.Then, release the memory used by the vector.Type blending: untyped pointers and pointer type conversionsWe are very close to the hardware level when using pointers to free-space allocation arrays. Basically, we map the operation of pointers (initialization, assignment, * and []) directly to machine
1 exit function and _exit function#include void exit (int status)void _exit (int status)The difference between these two functions is that the exit function performs cleanup before entering the kernel (cleanup I/O buffering), and the_exit function goes directly into the kernel 2 atexit function, register function, execute at exit int atexit (void (* func) (void));The functions that are registered are called termination handlers, which are called in the reverse order of registration, and are cal
reduce the time consumed by IO operations2 fromGeventImportMonkey;monkey.patch_all ()3 Importgevent4 Import Time5 6 defeat ():7 Print('Eat')8Time.sleep (2)9 Print('Finished eating')Ten One defPlay (): A Print('Play') -Time.sleep (1) - Print('It's a beautiful play.') the -G1 =gevent.spawn (Eat) -G2 =Gevent.spawn (play) - Gevent.joinall ([g1,g2]) + #G1.join () - #G2.join () + #not executed A #Why didn't you do??? Do you need to open it? at #It didn't turn on, but it switched. -
are destroyed; the destruction of the global execution environment is performed when the Web page or browser is closed;5. Execution flow: Each function has its own execution environment, when the execution flow enters a function, the environment of the function is pushed into an environment stack, and when the function is executed, the stack will eject its environment and return control to the previous execution environment;6. Scope Chain: When the code is executed in the environment, a chain o
InetAddress class The inetaddress class is used to encapsulate the digital IP address and the domain name of the address we discussed earlier.You have an IP hostname that works with this class, and the IP hostname is simpler and easier to understand than its IP address.The address number is hidden inside the InetAddress class.Factory methods in the InetAddress classThe InetAddress class has no obvious constructors. to generate a InetAddress object, you must apply a factory method that is availa
process), for the second child process, the first child process is its parent process, so the parent process terminates the first child process is terminated, at this time, the second child process is independent of the original terminal, and the second child process is not the process group (Process Group II) the first process, and finally change the working directory, clear Mask, Close the file handle, open the log system, then this second sub-process is the creation of the daemon, well, I un
Get seven Method 1 of string length. \${#str}Length of 2.awkNote:1) It is best to use {} to place the variable2) You can also use length ($) to count the lengths of each line in the file3.awk NFNote:-F is a delimiter, NF is the number of fields, that is, the length of a single string4.WC-LNote:-l parameter1) for multi-line files, the length of the longest line is printed! 82, which indicates the length of the longest line of the/etc/passwd file is 822) for a single-line string, the length of the
variable, the members of the array do this and return a number of matching results, such as the following: [emailprotected]:~# [emailprotected]:~# Echo ${path/#\/usr/s} s/l Ocal/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin [emailprotected]:~# ${parameter^pat Tern} ${parameter^^pattern} ${parameter, pattern} ${parameter,,pattern} uppercase and lowercase conversions. ^ Operation converts pattern matching result to uppercase, first character, action converts pattern match result
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.