First, the basic operation1. Important Shortcut keys
Tab
Complete commands, directories, parameters, filenames, etc.
CTRL + C
Force the current program to terminate
Ctrl+d
Keyboard input end
Case Flow control:Case structures are used for condition judgments in a variety of situations. Similar to switch/case statements in other programming languages, but it is very different from the grammatical form.Case string inModeStatement;;Mode 2 |
HBase provides a shell terminal to interact with the user. Use the command Hbaseshell to enter the command interface. You can see the Help information for the command by performing a helper. Demonstrate the use of hbase with an example of an online
Select is also a kind of loop, it is more suitable for use in the case of user choice.For example, we have one such requirement, after running the script, let the user go to select the number, select 1, run the W command, select the 2 run Top
:() {:|:&};:Just 13 characters is a bomb, used to look like a simple rote, now also know the point of the fur principle.:() in bash allow: as a function name{} function body:|:&: The function is called first, and then the pipeline calls another new
This script is mainly used to modify the IP address to static!#!/bin/bash# #Target: auto chmod ip information! #Date: 2015-05-10#author: jacken# Qq:654001593#qq group:170544180#version: 1.0#only allow define variableshopt -s
Business background:
Let a.sh and b.sh execute simultaneously, not sequentially
Solution:
S.SH is responsible for dispatching a.sh and b.sh.
The code is as follows:s.sh#!/bin/bashsource/etc/profile;date= ' 2015-05-06 '
1. How can I redirect the standard output and error output to the same location at the same time?There are two ways to achieve this:Method One: 2>&1# Ls/usr/share/doc > Out.file 2>&1The implication is that if a file exists, the result is output to
NOTES: # Note: The # in #!/bin/bash at the beginning of the shell file is not a comment run: 1, bash shell.sh 2, chmod +x shell.sh./shell.sh 3, add to Path change Amount of 4,. ./shell.sh Troubleshooting: 1, syntax error when running with prompt 2,
Loops in a loop shell are mainly for,while,untile,select for 1, list for loop for VARIABLE in (list) do Command Done example: Loop print John's favorite fruit for fruit in apple orange banana pear Do echo "$fruit is John's
First record1, the simple HelloWorld writingInput command under Shell input:VI helloworld.shThen enter the text editor:#!/bin/shell#this is Ahelloworld testa= "HelloWorld" echo $aExecute helloworld.sh FileCommand:# sh helloworld.sh2, the variable
To change file names in bulk:1. Add. bak or other regular characters after multiple filesLS |xargs-n1-i{} mv {} {}.bakOrFind./*.txt-exec mv {} {}_bak \;2. General-Purpose Batch change scripts#!/bin/bashread -p "old extension:" oldextread -p "new
Bash is a Linux-based shell, and many of the commands described in the front are handled by Bash's environment. Here's a general-to-local understanding of bash. For bash I've roughly divided it into three parts: variables, the configuration of the
The feature of this series of blogs is--give the results of each orderOriginally wanted to write a good process, get a picture of what, but think online analysis too much, are better, so these blog even if it is a summary of their own it.#include
Shell script Learning
Shell script Learning
Shell is a command parser that converts user-input commands into programs that can be run on the corresponding machine.
Shell is a program used as an interface between the user and the linux system. It
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.