Array usage in shell scripts in Linux

In the shell (I'm bash here) there is no traditional "data type", and the values stored in any variable are "strings" of characters. Of course, you can declare a variable to be an integral type, an array, and so on by declare. Among them, the array

The Shell Common Command summary under the Linux server

1.   Find        find Pathname-options [-print-exec-ok]  & nbsp;     Let's take a look at the parameters of the command: The directory path that the        pathname Find command is looking for. For example, to represent the current directory,

Unable to enter ADB shell to prompt for unknown host service workaround

Today monkey's simple environment configuration, ready to start monkey, but in the Command Control window input Unable to enter the ADB shell, prompted the error "Unknown host service"find the data found that because the computer's 5037 port is

Shell parsing nginx Access log log

Statistics the most visited IP1. Tail-n 10000 Xxaccess_log | Cut-d ""-F 1 |sort|uniq-c|sort-rn|head-10 |more2.tail-n 10000 Xx-access_log | awk ' {print '} ' |sort|uniq-c|sort-rn|head-10 | MoreStatistics the most visited URLsTail-n 10000

Some of the supernatural powers of ${} in the shell

Suppose we define a variable as: file=/dir1/dir2/dir3/My.file.txt We can replace each other with ${} to get different values: ${file#*/}: Take out the first/its left string: Dir1/dir2/dir3/my.file.txt${file##*/}: Take out the last/and left string:

Built-in string processing tool for Shell programming

Bash's built-in string processing tool:String slices:${var:offset:number}Takes a substring of a string;Take the rightmost few characters of the string: ${var:-length}Note: There must be a white space character after the colon;To take a substring

Into a dead end or into a cul-de-sac--shell script obtains PID of Dubbo service by name

In the afternoon, suddenly feel restless, probably because there is no good rest at noon. Laotaibuxiao is still doing the page integration thing, this is the work to do when the job. Then suddenly want to challenge the advanced point of the defect

Keepalived+nfs+shell Script Implementation Nfs-ha high availability

Originally wanted to do drbd+heartbeat, but the leader said to add hard disk waste of resources, not necessary, and in the existing hard disk to do a large risk, so it can only use rsync to achieve data synchronization, the experiment found a lot of

Keepalived+nfs+shell Script Implementation Nfs-ha high availability

Originally wanted to do drbd+heartbeat, but the leader said to add hard disk waste of resources, not necessary, and in the existing hard disk to do a large risk, so it can only use rsync to achieve data synchronization, the experiment found a lot of

Shell-Related Tips Summary application (1)

1. Run the command as a specified userRunuser-work-c "Cd/home/work/uc/bin && sh start.sh"Runuser-push-c "Cd/home/push/mucs/bin && sh start.sh"Or:Daemon--user mongod "Mongod--config conf/mongod.conf"Daemon is a function name that needs to be

WordCount Interactive analysis in the Spark shell based on the HDFs file system

Spark is a distributed memory computing framework that can be deployed in yarn or Mesos managed distributed Systems (Fully distributed) or in a pseudo distributed way on a single machine. It can also be deployed on a single machine in a standalone

The first time you see spark crash: The spark shell memory Oom phenomenon!

The first time I saw Spark crashSpark Shell Memory Oom phenomenonTo do the spark graph calculation, so with Google's web-google.txt, size 71.8MB.With the command:Val graph = Graphloader.edgelistfile (SC,

Shell date plus minus

Shell date Plus and minus operations such as today is 2012-04-22$ date-d "+1 Day" +%y-%m-%d2012-04-23 $ date-d "-1 days" +%y-%m-%d2012-04-21 $ date-d "2012- 04-10-1 Day "+%y-%m-%d2012-04-09 $ date-d" 2012-04-10 +1 Day "+%y-%m-%d2012-04-11 $ date-d"-1

Shell echo Command

Echo is an internal command of the shell that prints the specified string on the screen. Command format: Echo Arg You can use echo to achieve more complex output format control.Show escape characters echo "\"It is a test\ ""

Bash Shell Learning 01 (Configuration and startup scripts)

Bash is Bourne Again shell abbreviation, developed from the UNIX system shView current ShellEcho $SHELLView system-supported shellsCat/etc/shellsCd/binLs-la *shFirst, the bash shell configurationVariables can be divided into custom variables and

Shell script "Bc:command not found" resolved

Recently debugged a script, in one environment, normal operation, in another server environment, the error "BC: Command not foundFind the following problems:The Linux character interface also has the calculator, that is bc!The operating method is

Fifth chapter shell functions and Arrays

5.1 FunctionsFormat:Func () {command}Example 1:#!/bin/bashfunc () {echo "This is a function."} Func# Bash Test.shthis is a function.The shell function is simple, with the function name followed by a double parenthesis and the double curly brace.

How to invoke execute Shell script in Java code

Tag:.sh   log   command   int    Command     java    call    ack   mod    // usage: runtime.getruntime (). EXEC ("command"); String Shpath= "/test/test.sh"; // Program Path Process process =null; = "chmod 777" + Shpath; Try {

Linux Shell multithreaded Execution program

There is no real multi-threading in the shell, and to implement multithreading you can start multiple back-end processes to maximize CPU Performance.Look directly at the code Example.(1) Sequential execution of code1#!/bin/Bash2 Date3 forIinch`seq 1

Two methods of Shell/. sh script encryption in centos linux (shc and gzexe)

Shc methodShc is a tool for encrypting shell scripts. It converts shell scripts into executable binary files.Automated maintenance of the system using shell scripts is simple, convenient, and portable.However, shell scripts can be read and written,

Total Pages: 541 1 .... 163 164 165 166 167 .... 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.