By failing time after time, I finally master the tricks of writing Linux Shell, the most classical examples were the usage of 'if' sentence in Shell language. Here are the tips and samples:
Semantics:
If [conditions]; then
Command
Fi
Windows powershell cmdlet
The cmdlet (read as "command-Let") is a single function command used to operate objects in Windows powershell. The name format can be used to identify the verbs and nouns separated by hyphens (-), such as get-help,
Reading the Linux Shell written by othersCodeSuddenly found a lot of code similar to the following format:
["$ Pro" = "1"] & ckssl = "-- SSL" [-n "$ IP"] & ckip = "-h $ IP" [-n" $ port "] & ckport ="-p $ port"
I didn't understand why I wrote
1. Variable type in Shell
Shell variables can be divided into environment variables, location variables, pre-defined special variables, User-Defined variables,
2. environment variable
Environment variables in shell are shell predefined variables
Sometimes, the execution path of the entire shell script file is determined based on the command execution result status.
A simple requirement is to determine whether a row of content exists in a file. If yes, no operation is performed. Otherwise,
All Unix users should understand how to use the Korn shell script. By writing shell scripts, You can automate many tasks and save a lot of time. It seems daunting at first glance, but you can use it skillfully as long as you follow the correct
The method for listing all Shell objects is not provided below. For more information, see Ishelldispatch: Public idispatch {// you must specify the name of the control panel program. cpl suffix hresult controlpanelitem (BSTR szdir); // causes the
How to extract the line Content Code specified by the file:
If you only want to view the first five lines of the file, you can use the head command,For example: Head-5/etc/passwd
If you want to view the last 10 lines of the file, you can use the
Reprinted statement: This blog article allow free reprint, but reprint need to indicate the author, source: Denny wqf363@hotmail.com Source: www.huntmine.com
Shell-specific variablesTable 14-2 specific s h e l variable $ # number of parameters
Bash cannot handle floating-point operations and lacks specific operations. These operations are important computing functions. Fortunately,BCThis problem can be solved.BCNot only is it a flexible and precise tool with multiple functions, but it
During distributed parallel computing, you often need to upload compiled files to the same directory of each computing node. when there are many computing nodes, this work is quite tedious. the following example shows the script for transferring
LinuxIf command
WhateverProgrammingLanguage is inseparable from conditional judgment. Shell is no exception.If list thenDo something hereElif list thenDo another thing hereElseDo something else hereFi Ex1:#! /Bin/shSystem = 'uname-S' #
Lu1 (){Echo 'aaaaaaaaa'}
Lu2 (){Echo 'bbbbbbbbbbbb'}The above is the source code of run. Sh. We can see that there are only two function definitions and there is no place to call these two functions. If we execute these two functions like
I have been busy with projects recently and encountered a very tangled problem in the process. Other shell scripts can be called only after the shell script training database is executed. Here we will summarize and share it with you.
The script is
1. Introduction
Hbase is a distributed, column-oriented open-source database. It originated from Google's paper bigtable: a distributed storage system for structured data. Hbase is an open-source implementation of Google bigtable. It uses hadoop
At ordinary times, I seldom have time and energy to watch the live broadcast of the five major league matches. But I still pay close attention to the progress of the competition. However, I have to check the information online and have a lot of
Pipeline commandThe operator is: "|", which can only process the correct output information transmitted through the previous command, that is, the standard output information. For stdandardError information is not directly processed. Then, pass it
Object pipeline is a convenient feature of PS. One of the main advantages of using an object is that it enables the use of pipeline transmission commands (that is, it is much easier to pass the output of a command as input to another command.
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.