$: The script name, relative path, or absolute path depends on how the call is being invoked. If the./dollartest.sh call is in the parent directory, then $ is./dollartest.sh, if it is a full path call, such as "/root/test/dollartest.sh", then $ is "/
Source:
Public StaticString CreateFile () {String cmd ="Echo\"Hhahah\"> F:\\AAA\\Azzz.txt "; File File =NewFile ("C:\\Windows\\System32 "); StringBuilder result =NewStringBuilder ();Try{//execute the specified string command in a separate process
Unlike Java, PHP and other languages, the process control of SH is not NULL, such as:
public class test{public
static void Main (string[] args) {
int a = ten;
if (a > 5) {
System.out.println ("A is greater than 5");
Sed is an online editor that handles a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer, known as pattern spaces, followed by the SED command to handle the contents of the buffer, and
Note: The example of this article comes from the collection and collation of the network, with my comments attached. Common uses of ①i/o redirection
Symbolic meaning
cmd1 | cmd2 pipe character, the standard output of CMD1 as the
echo Outputecho instruction for the output of a stringFormat: Echo stringDirect output String: stringEcho ' This is String-output 'In double quotes, you can also omit quotes here.Escape character: \echo ' \ ' It is ok\ 'Variable: \valueEcho ' \value
I. Condition TEST ACTIONThe shell environment determines whether the execution succeeds based on the return status value ($?) after the command executes, or if the return value is 0 o'clock, which indicates a success or failure or exception. You can
In daily work, the bash shell has a very frequent time operation. For example, when the shell script sends statistics periodically, it will check whether the scheduled send time is current. Or when you use a file to save some data, a time string is
$ () and ' (anti-quote)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
Tag: equals $? Additional command redefine the txt dir bin integer$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.# echo ' which who '# echo $ (which who)/usr/bin/whoThey're getting the same results.
First, conditional judgment statementMeet the criteria to execute the corresponding command[Condition]: more commonly used in scriptsCases:[-f/etc/hosts]Test condition: More commonly used for Linux character terminals1. File or directory judgment-F:
It usually takes a long time to run some monitoring tools or disk check tasks in shell.ProgramThe sighup signal is received to terminate the operation. Obviously, this is not the case.The nohup and bash built-in commands disown can solve this
From: http://wowubuntu.com/linux_shell_1.html
The best Linux Shell Command series serialization (1)
9th2010
# Author: Riku/This article uses CC BY-NC-SA 2.5 protocol authorization, reprint please note this article link.
NOTE: With the consent of
BASH Shell script learning Summary. It is easy to determine whether a log file is larger than 2 GB. If it is larger than 2 GB, delete it. I haven't written bash for a long time, so I can't even think of it. So I reviewed it and made a summary of
Basic shell programming
1. Start Script Programming
#! The/bin/sh line is the shebang line, which tells the system that the following command is executed by shell.
#!/bin/shPERSON="Yuesichiu"echo $PERSONecho "what is your name?"read PERSONecho
In makefile, shell commands are often used, and $ VaR are often used. What is the difference? The difference is big. Do not consider using $ VaR in the command line of the makefile rule to share the variables of makefile with the shell. Here, only
1. Shell uses quotation marks (single quotation marks/double quotation marks) and backslash ("\") for the shell interpreterSHIELD special characters.
Reverse quotation marks [H2] have special significance for shell.
1.1 single quotes and backlash [
Linux-shell-|, & {}, (), reg-command execution sequence
&&Format: command 1 & command 2Purpose: & after the command on the left (command 1) returns true (that is, 0 is returned, successfully executed), the command on the right (command 2) can be
This is an entry-level article. If you are already a shell expert, please kindly advise, 3ku!
I recently used Linux Shell in an entire android project ??????!!
Fortunately, I have only written some simple shells before, and I have read a lot of
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