Recently, writing shell scripts under Linux is almost as close to learning as writing. Record some learning experience here.
a) The shell's quotation marks.
the shell's quotes have single quotes ', double quotes ', and inverted quotes '.
A
The most crude version
Shell Code
Find. -name "*.java" |xargs wc-l|grep "Total" |awk ' {print $} ' find
.-name "*.java" |xargs cat|wc-l #Output: 37634
The above two sentences are the same, but the second one is to use cat to merge the
A simple description of the process of writing a shell script in Linux
1, use VIM or gedit to create a file, usually use. sh as a file suffix
2, "#!/bin/bash" as the first line of statements, which "#!" Known as the "Sha-bang" symbol, is the
Step one: Construct apps in index.html, pages, shellStep two: In the shell controller JS code in the OnInit method Addcontent (APP)
First Step code:
Sap.ui.localResources ("mobile");
var app = new Sap.m.app ({initialpage:
How shell scripts are executed:NOTE: WD stands for "Script saved directory"
1.forkSyntax:/wd/shell.shFork is the most common, is directly in the script with/wd/shell.sh to call shell.sh this script. Run a child shell executes the calling script when
First, Shell script introductionThe shell is a scripting language, and the shell is a collection of system commands1, can use logic judgment, cycle and other grammar;It's a bit like C language, but it's fundamentally different.2, can be customized
Shell Script IntroductionShell is a scripting languageYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly
Click to view the original blog.sedis the abbreviation for Stream editor, which is a non-interactive stream editor for filtering or converting text.Not to be continued ...ProfileSed Options ... Script [Input File ...]DescribesedThe editor is called
On-line websites generate log data every day. If there is a requirement: Log files generated by the day before the start of the operation at 24 o'clock in the morning are expected to be uploaded to the HDFS cluster in real time.
How to do it?
Regular Expressions && text-processing toolLearning Goals:L Mastering the use of regular expressionsL MASTER the use of SED and awk text processing toolsDirectory structure:Regular expression Regular Expressions overviewL Regular Expressions: Use a
The shell itself is a program written in C, which is a bridge for users to use Linux. The shell is both a command language and a programming language. As a command language, it interprets and executes user-entered commands interactively, and as a
Iv. Steps of the experiment
1.Shell basic usage of variables and usage of common symbolsThis section requires writing out the shell commands that implement the requirements , showing(1) Change the main prompt to the user's home directory name(
I. Logical judgments in the shell
Format 1:if condition; Then statement; Fia=2if [ $a -ge 2 ];then echo ">=2";fi
Format 2:if condition; Then statement; else statement; Fia=1if [ $a -ge 2 ];then echo ">=2";else echo "
Format 3:if ...;
Shell scripts can be executed in the following ways:Way One:./script.sh # using a decimal point to performWay two:SH script.sh or bash script.sh # using bash (SH) to execute scriptsThe previous two methods are all the same: they are
In order to do cluster testing, 3 tomcat is installed on each machine, each time the project is released, it is necessary to repeatedly knock some commands, check that the Tomcat process has not stopped before restarting Tomcat, and kill the process
Author: @n4ckhcker & @h4d3sw0rmIntroductionHello, so first of all let's explain what's a restricted shell? A restricted shell is a shell this block/restricts some of the commands like Cd,ls,echo etc or "block" the environment Var Iables like
We may encounter scenarios in which a program on a Linux server must be timed out on every weekday. So is there a way to implement this function? The answer is yes. We can use shell scripts to simply implement this function.The rationale is simple:
1.export commandThe Linux Export command is used to set or display environment variables.When executing a program in the shell, the shell provides a set of environment variables. Export can add, modify, or delete environment variables for use by
from Windows to the Linux of the Shell scripting Coding and formatting issuesShell script encoding and formatting issues from Windows to Linux1, abnormal problem: set Ff=unix
Startup script in the start times error, such as the execution of
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.