[Shell] Shell Common Special symbols

Meet Meaning && Command1 && command2: Command 1 returns True (Command return value $ = = 0), command 2 can be executed. Can be used for if judgment.CP 1.txt.. /&& echo "succes" #-->successCP 1.txt.. /&& rm-f. /1.txt && echo

A shell-init error occurred while executing a shell command (directory does not exist)

Occurs when a service command is executedShell-init:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or directoryChdir:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or

Basic syntax structure summary of Shell programming basics

First, conditional statements Simple conditionsif Then # When the condition is established, the content is executed;fi If the reverse is written, the meaning offiif Complex conditionsif Then # When condition is established, execute

MUTT+MSMTP implementing e-mail in a shell environment

139 e-mail message will be sent automatically after the email, using this function can send the server's exception information to 139 boxes and then the phone will receive SMS reminders, to facilitate the management of the server function.To avoid

Linux Modify shell command prompt and color

Zhanhailiang Date: 2014-10-181. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as

Linux Shell user Input--organize

There are three main forms of processing Linux input in shell scripts:1) Treat them like command line arguments, and obtain corresponding input parameters by corresponding positional parameters2) through getopt and getopts These two commands 3)

Shell Learning & | what is the difference?

Tag: Shell Before answering the questions in this chapter, let's first understand the concept of return value!Each Command or function we run in shell will return a value of the parent itinerary at the end,Return Value.Available in shell command

Execute another shell script in the shell script

Category:  You can execute another shell script (or non-executable file, mainly used to obtain the value of some variables) in one shell script :. file name (including path) or variable = file name (including path ). $ variable Note: there is a

Shell scripts convert files from GBK to UTF-8 Encoding

Http://www.jb51.net/article/51308.htm 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 #!/bin/sh    ##  ## convert file from GB2312 to UTF-8 ##    path="$1"unset opt if [ "$2" = "force" ]; then    opt=

How to take the characters in parentheses in Shell

1. Use grep (the result is enclosed in parentheses. I wonder if I can match the content in the brackets only) $ A = 'abc [EDG] adfirpqu '$ echo $ A | grep-O '\[. * \] '# escape [EDG] $ B = 'abc (EDG) adfirpqu' $ echo $ B | grep-O '(. *) '(EDG) 2.

Shell Automatic Logon script

#! /Bin/baship = 'awk' {print $1} '/home/bash/mima.txt' For I in $ ipdo {Port = 'grep $ I/home/bash/mima.txt | awk '{print $2} ''pawd = 'grep $ I/home/bash/mima.txt | awk' {print $3}'' CT This article from the "IT technology personal opinion" blog,

If judgment in Shell

Tag: String null Integer comparison: -EQ equals to, for example, if ["$ A"-EQ "$ B"] -Ne is not equal to, for example, if ["$ A"-ne "$ B"] -GT is greater than, for example, if ["$ A"-GT "$ B"] -Ge is greater than or equal to, for example, if ["$

6 basic specifications and excellent habits of shell script Development

1. Specify the script interpreter at the beginning #! /Bin/sh or #! /Bin/bash 2. Provide the function description, author, version, and other information at the beginning # Description: # Author: # contact: # Last edited: # version: Note: you

Hadoop shell Operation Command

Shell operation command: HDFS path, defined in core-site.xml fs. Default. Name HDFS: // master. hadoop: 9000 master. hadoop namenode Host Name Use/to replace the current absolute path Hadoop FS-ls/View content in the root directory of

Shell numeric operation

1. Five methods for calculating the value: (I ++ )) Let I ++ I = $ (expr $ I + 1) I = $ (echo $ I + 1 | BC) I =$ (echo $ I 1 | awk '{printf $1 + $2 }')   2. The time command is used to

Shell string operation

1. The length of the string, for example: * $ Var = "Get the length of me" $ Echo $ {# var} 20 * $ Expr length "$ Var" # note that double quotation marks are used. 20 * $ Echo $ var | awk

Shell exercise: Analyze Nic Information

  Use shell scripts to analyze Nic status information Question: Shell programming1. Write a script to read the traffic on the NIC, the number of packets received and sent, the number of packet loss, and the packet loss rate;2. The NIC name must be

Shell BASICS (4) arithmetic operations

--- Content from http://www.jb51.net/article/31232.htm By default, values assignment and operations in shell are processed by strings,1. Example of an error methodA)Var = 1 + 1Echo $ VaRThe output result is 1 + 1. Tragedy.B)Var = 1Var = $ var +

What is the difference between $ @ and $ * in shell learning?

What is the difference between $ @ and $ * in shell learning? Before talking about $ @ and $ *, you must start with the positional parameter of shell script...We all know how variables are defined and replaced.However, we also need to know that

[Shell] example of if, for, while flow statement and integer string comparison

[Shell] example of if, for, while flow statement and integer string comparison Preface: In fact, Shell is a command interpreter that explains the commands entered by the user and sends them to the kernel. In addition, Shell has its own programming

Total Pages: 541 1 .... 266 267 268 269 270 .... 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.