What are the special characters in the bash shell? Some special characters in the bash shell do not represent the meaning of their characters themselves, but have another meaning, called: meta-meaning.
1. Characters: #
Represents a
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
Reproduced:http://imysqldba.blog.51cto.com/1222376/616805There are three ways to execute a shell scriptBash script name sh script name chmod +xUse the following statement to test#a. SH (does not have extension)CD/Pwdecho "Complete"However, the
The logical operators of the shell involve the following types, so as long as the appropriate choice, can solve our many complex judgments, to achieve a multiplier effect.First, the logical operator
Logical Volume Label
Express
Variable Variablename=value
Cannot have spaces around equals sign
Variable content has a space to use "or", but v= "Hello $name" $ to maintain the original function, single quotation marks do not, v= "Hello ' $name '" plain text
Use
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
Today when writing a shell script to find the need to set the user's password, and the setting of the password is interactive, so in the script is obviously not very good, so the Internet to find information, found the following two non-interactive
After you install Lync2013 on Windows R2, the Lync Management Shell does not open properly, such as:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/41/5A/wKioL1PTfSrS4XniAAC4xFArUeA489.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiol1
To make it easier for you to review your memory, we will summarize the hadoop commands of today's experiment for later viewing. Note: The following commands are performed in hadoop/bin. 1. hadoop FS-ls \-> View All the following directories. 2.
We have introduced the core implementation principles of mainstream double-layer encryption shells,At the same time, we mentioned compatibility and simplified the encryption Shell Core while considering the security.This article mainly discusses
1. Host
1) DNS lookup Utility
Host option {name} [server]
Use/etc/resolv. confMedium serverAs the source of the DNS server
2) Option
-A: lists detailed host name settings for this host.
3) Example
Host www.google.com
2. NSLookup-
The basic course of Linux Shell script describes the beginning, comments, variables, and environment variables of the basic syntax. Here we will introduce the first part of the shell command and control process, three types of commands can be used
A simple ShellProgram
Let's look at a shell program.
-----------------
#! /Bin/sh # this is to show what a example looks like. echo "our first example" Echo # This inserts an empty line in outputecho "we are currently in the following
Simple example shell program
Example 1.
#!/bin/bash#This is to show what a shell script looks likeecho "Our first example"echo # This inserts an empty line in output.echo "We are currently in the following directory."/bin/pwdechoecho "This
Bash supports many operators, including Arithmetic Operators, Relational operators, boolean operators, string operators, and file test operators.
Native Bash does not support simple mathematical operations, but can be implemented using other
Location parameters can be used
shiftCommand left shift. For example
shift 3Indicates the original
$4Change
$1, The original
$5Change
$2And so on.
$1,
$2,
$3Discard,
$0Do not move. Without Parameters
shiftThe command is equivalent
shift 1. Very
As mentioned above, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings. Such variables are called special variables.
For example, $ indicates the ID of the
[Shell Study Notes] the sort and uniq commands sort the text, single and repeat the document directory [hide]
Sort command syntax
Common options
Common sort usage
Uniq command
Command Options
Uniq usage
Sort is a commonly
When it comes to shell wildcard (wildcard), it is often used. The following is an example:
#1
[chengmo@localhost ~/shell]$ lsa.txt b.txt c.old#2
[chengmo@localhost ~/shell]$ ls *.txta.txt b.txt#3
[Chengmo @ localhost ~ /Shell] $ ls d *.
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