Shell scripts that perform fast and easy to understand code. In the process of writing shell code, it is often used to read the file contents. Notation One:----------------------------------------------------------------------------#!/bin/bash while
File D.txt The following contentGGG 1portals:192.168.5.41:3260Werew 2portals:192.168.5.43:3260How to change the file D.txt content to the following contentGGG 192.168.5.41:3260Werew 192.168.5.43:3260Problem Solving Ideas:[[email protected] study]#
The following hello is the start time, world is the end time#!/bin/Bashstart=$(Date+%s); Hello="20160911 xx" World="20160911"Datebegin=`Date-D"$hello" "+%y%m%d%h"' DateEnd=`Date-D"$world" "+%y%m%d%h"` while["$datebegin"-le"$dateend" ]
Shell scripts can be seen as a stack of commands, implemented by combining command flow control mechanisms.The interpreter #!/bin/bash or/usr/bin/python is also known as ShebangThe generic script needs to give execution permission, or you can use
No hurry, step-up, first lay a good foundationThe Spark Shell principle First, we clearly locate the few.1, Spark-shell2, Spark-submit3, Spark-class4, Sparksubmit.scala5, Sparkiloop.scalaSource Code of InitializesparkDef Initializespark () {
You can use the semicolon ";", the double ampersand "&&" and the Double vertical bar "| |" in Linux To connect multiple commands.1.3.1 Semicolon;When multiple commands want to be executed at the same time on a single line, a semicolon ";" can be
Format: echo "/033[word background color; font color m string/033[control code"If you simply display the font color can be fixed control code bit 0m.Format: echo "/033[word background color; font Color m string/033[0m"Word background color range: 40-
1. Man helps explain commands you are familiar with or unfamiliar with
Eg:man ls to view LS-related usage
Note: Press the Q key or CTRL + C to exit, under Linux you can use CTRL + C to terminate the current program run.
2. LS to view the
Linux shell directives such as-D,-F,-e are judged by :File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file
Linux Classic Shell command collation1. Delete a 0-byte fileFind-type f-size 0-exec rm-rf {} \;2. View the processSort by memory from large to smallPS-E-O "%c:%p:%z:%a" |sort-k5-nr3. By CPU utilization from large to small arrangementPS-E-O "%c:%p:%z:
TopicsSourcehttp://acm.hdu.edu.cn/showproblem.php?pid=5730DescriptionPerhaps the sea ' s definition of a shell is the pearl. However, in my view, a shell necklace with n beautiful shells contains the most sincere feeling for my best lover Arrietty ,
1. Crontrab for Linux in the projectScheduled execution under Linux is mostly done using a custom plan in the crontab file, but it's not very complex, and it's basically remembered once and for all, and the key is to remember the/var/spool/cron
1. Introduction of the Linux command return valueWhen the shell executes a command, it has a return value that is stored in the shell variable $?. When $? is 0 o'clock, the command execution succeeds; when $ = 1 o'clock, the command execution fails.2
Dynamic language: Interpreted language, is a weak type of language, Characteristics: Edge interpretation edge execution. Example: PHP, SHELL, Python, PerlWeak: variable time declaration, or even type-insensitive.Strong: Variables must be declared
A 9x9 multiplication table was written with a shell script, for reference only! Text below ...650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/53/wKiom1fc_6mT0-TPAABEz2kbGyk527.png "title=" 99.PNG "alt="
Write a bash shell scriptThe script is as follows: it is used to monitor the number of mongo connections and restart the system.#! /Bin/bash# Source/etc/profileConn = '/usr/bin/mongo -- quiet Db. serverStatus (). connectionsExitEOF`Conn1 =$ {conn #*:
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