Writing shell scripts to start and stop programs

The two-day project online I've been busy. Three days overtime. But there's still a harvest. Premise: When you write the startup script start.sh, cycle to start the change process While True Java-jar Xxx.jar Done When starting, of

How to embed the HBase command in a Linux shell __linux

We often use the The first EOF must begin with the redirection character

Shell scripts for extracting files and merging large numbers of small files

zip

Script file name is unzip-batch.sh# bulk decompression compressed files, extract files to the specified directory#!/bin/bashFor zipfilenamefull in ' ls./*.zip 'Todo#echo "$zipfilename"Zipfilename= ' basename $zipfilenamefull 'filename=$ (basename

Shell Script Exercise II

Print 99 multiplication table#for Statement Format#!/bin/bashfor ((a = 1; a Dofor ((b=1; bDoLet Sum=b*aEcho-ne "$a * $b = $sum \ t"Doneecho ""Done#while Statement Format#!/bin/bashA=1While [$a-le 9]DoB=1While [$b-le $a]DoLet sum= $a * $bEcho-ne

There are two ways to run a Shell script:

1. As an executable programSave the above code as test.sh and CD to the appropriate directory:+./test. #使脚本具有执行权限./test. #执行脚本 Note, be sure to write ./test.sh, not test.sh, run other binary programs also, the direct write Test.sh,linux

Use the shell to intercept a specified timestamp log to another file

1, using the shell to intercept log logs for a period of time can use the SED command to extract the log file:The command is as follows:#sed-n '/1531324800/, $p '/data/log/mosquitto/mosquitto.log >> log.log"1531324800": This is the start timestamp,

Shell Programming Specifications and variables

Concept:The commands that will be executed are saved sequentially to a text file, which can be run by giving the file an executable permission.The composition of the shell script:1) Script statement: The script declaration indicates which

01-01 Shell-based data analysis

#!/usr/bin/env BashFor year in/root/downloads/data/all/*DoEcho-ne ' basename $year. gz ' "\ T"Gunzip-c $year | \awk ' {temp = substr ($ 88, 5) + 0;Q = substr ($ 93, 1);if (temp! = 9999 && q ~/[01459]/&& temp > max) max = temp}END {print Max} 'Done#!/

Shell Programming Test Command

The testing Test command in shell programming can basically be divided into 3 data types, each of which is different. Individuals are more inclined to understand the rules of writing conditional statements, that is, test plus conditional plus

Some special variables in shell scripts

In shell scripts, there are some common special variable representations that need to be known.Here are some of the frequently used special variable representations:$ Current PIN name$ ... Parameters of the incoming script or function (greater than 1

The shell variable definition uses

Shell: 1, local variables: variables available only in the current shell, 2, Environment variables: variables available for the current Shell's child processes 3, Shell variables: some shell Set the special variables, such as: $ $, $ ... These

Self-study Linux Shell5.1-shell parent-child relationship

Click Back to learn the path of the Linux command line and shell script5.1-shell Parent-child relationship1 common types of shells Bash is the Linux standard default Shell, which is an abbreviation for the Bunrneagain shell, with a total of

function and cyclic control of Linux--shell programming

Functions: Code snippets that implement standalone functionalityfunction is only executed when calledSyntax One:function f_name{function body}Syntax Two:F_name () {function body}The return value of the function:Default function return value:

Shell Script Bitwise operation +FOR Loop + return value to undertake

Implementing a certain bit of a register with a shell scriptPit bit 1:Not recognized on the Development Board (Ubuntu can)For ((i=0;iDoDoneInto:For i in ' seq 0 6 'DoDonePit bit 2:return value by default only 8 bits are truncated.Setbits $ $4Regv=$?

SHELL–ITEM2 Color

DownloadPlease download it to https://github.com/mbadolato/iTerm2-Color-Schemes.git clone https://github.com/mbadolato/iTerm2-Color-Schemes.gitInstallationTo install: Launch ITerm 2. Get the latest version at iterm2.com Type cmd+i (? +i)

Shell Scripting Exercises

1, write the script/root/bin/createuser.sh, to achieve the following functions: Use a user name as a parameter, if the specified parameter of the user exists, it will show its existence, otherwise added; Displays the ID number of the added user and

Daily Shell Exercises (06)--Detection port service

1. TopicsWrite a script to determine whether the 80 port of the machine (assuming the service is httpd) is open, if it is open to do nothing, if the discovery port does not exist, then restart the httpd service, the concurrent mail notify yourself.

Shell Programming (1)

1/ETC/PASSWD: User account information/etc/shadow: Secure user account information/etc/group: Group account information/etc/gshadow: Security group account information2ID: View the user ID and group ID of the current userId-u: Show only User IDId-u

HADOOP04---Shell

After MySQL installation on Linux uninstall is not clean, ping server ping does not pass the ICMP protocol is closed, Ping is using the ICMP protocol. Export is a global variable that all users can log in to use.Introduction to 1.iptables firewall

Nine arrays in the shell

Array: A variable that stores a set of data and is able to manipulate one of the data in this set of data individually.Types of arrays: one-dimensional arrays, two-dimensional arrays, multidimensional arraysTypes of variablesThe default value of an

Total Pages: 541 1 .... 340 341 342 343 344 .... 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.