The use of $ in a shell script

$: 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 "/

How to invoke a shell script file in Java

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

Getting started with Shell programming Three: Process Control __ Programming

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 of shell

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

Introduction to Shell I/O redirection and the use of exec

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

Operator of the shell script (iv)

operator!/bin/bash #基本运算符 val= ' expr 2 + 2 ' echo ' two number of sum for ${val} ' #算数运算符 #* required backslash a=10 b=20 val= ' expr ${a} + ${b} ' echo ' A + b = ${val} "val= ' expr $a-$b ' echo ' A-B: $val ' val= ' expr $a \* $b ' echo ' A *:

Shell Programming-Output (vi)

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

Shell Script 2

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

Summary of common methods for time operations in bash shell

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

The difference between $ (()), $ (), ${} in the shell

$ () 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

The difference between $ (()) and $[] and $ () and ${} in the shell

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.

Shell conditional Judgment statement and if

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:

How to keep the process running after the shell exits

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

The best Linux Shell Command series serialization

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

Shell script learning Summary-string processing and branch statements

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 conditions, iterative process control, and arithmetic operations

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

Shell ($) in makefile)

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

How to use quotation marks in Shell

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

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

Linux Shell: ls and File Permissions

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

Total Pages: 541 1 .... 159 160 161 162 163 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.