Linux Gvim Shell variables

#!/bin/bashName="Matto" #变量名和等号之间不能有空格 #name="Blog4matto" #重定义name变量 #readonly name #设置name为只读变量 # unset name #删除变量, you cannot delete a read-only variable #${name}

III. shell variable types and operators

first, the application of shell variables1. Types of Shell variables·User-defined variables: defined, modified, and used by the user    ·Pre-defined variables: Bash predefined special variables that cannot be modified directly·Positional variables:

Shell-1.shell notes

Shell annotations1. Single-line CommentLines that begin with "#" are comments, which are ignored by the interpreter.debian:/# Vim first.sh#!/bin/sh#This is my first shell (this line is a comment)echo "Hello World"2. Multi-line annotationsThere are

Shell determines disk space delete file

#!/bin/bash# @loyu################################################################################Sum= ' Df-h | awk ' {print $} ' | Sed-n 4p | awk-f% ' {print '} 'If [$sum-GT 75]ThenDate= ' Date +%y%m%d 'Echo-e "\NPDT"Echo

The path is not shown in the Linux shell and is shown as two solutions for-bash-4.1#

This problem occurs because there is no configuration. Bash_profile problem, or we accidentally emptied or deleted the. bash_profile file.Method One: Modify the ~/.bash_profile fileThe steps are as follows:Vim ~/.bash_profile(No tube. Bash_profile

Shell Monitoring Host

1. Check the host network card traffic#!/bin/bash#networkWhile:; DoTime= ' Date +%m '-"%d" "%k": "%m"day= ' Date +%m '-'%d 'Rx_before= ' ifconfig eth0|sed-n ' 8″p|awk ' {print $} ' |cut-c7-'Tx_before= ' ifconfig eth0|sed-n ' 8″p|awk ' {print $6} '

Shell simple Use (b) loop

Record a few simple examples of loop-related1. Wait for the expected content to be entered#!/bin/Bashuntil["$yn"=="Yes"-O"$yn"=="YES" ] DoRead-P"Please input yes/yes to stop this progras:"yn DoneEcho "ok! You input the correct answer."Wait to enter

Shell that checks the system IP address and network card rate

The code is as follows:#ac = ' ifconfig -a | grep encap | awk  ' {print $1} ' ac= ' ifconfig |  grep encap | awk  ' {print $1} ' for i in  $acdo          if [  $i  ==  "Lo"  ];then         echo  $i         ifconfig  $i  |  grep  "inet addr"  | sed  '

Shell Debugging Method Summary

For tired print and Echo, try a little bit of fresh effort.1. Using the shell's execution optionsThe common execution directives for SH and bash are:-N,-X,-C,-V.which-N is a shorthand for noexec, which is to do only the syntax checking of the script

Shell Remote Execution command

SSH Main parameter description-L Specify Login user-P Set Port number-F run in the background, and recommended with the-n parameter-n redirects standard input to/dev/null to prevent reading standard input-N Do not execute remote command, only port

Use of variables in the shell (2)

Some knowledge of variables in the shell:Variable:1. By default, all variables are considered to be stored as strings.2. Variable case sensitivity3. Add $ to the variable name before accessing the content4. No declaration required5. The $ extension

Basic knowledge of Shell programming

1. Use the editor to write a file, which is the command entered in the shell, can be used through the PATH environment variable reference to the command.#! /bin/sh #! The following parameter is the program used to execute the script#后面是注释The rest is

Shell Script--Determine if the IP entered is correct

#!/bin/bash#It ' s written by Caibingsen#!/bin/bash#It ' s written by Caibingsen#date: 2016-03-15#while设置成死循环, re-enter when the IP entered does not meet the criteriaWhile:DoRead-p "Please enter the IP address to be judged:" IP#判断输入的ip地址是否仅由数字和点组成,

Create a user with a shell script

Create 20 users with shell script, ask 20 users to specify the home directory as/share/home/, and give each user randomly assigned a password, and finally record these user information in the log![[email protected] sbin]# vim 2.sh          mkdir -p  

Shell (10) sort

1. SortA. Sorting strings by default  B. With-r option: Reverse sort  C. Specify the option data field separator with-T, and the-K option specifies the data field to compare  D. Use the-N option to specify "pure digit sorting". As can be seen in the

Interview questions---various sorts. Insertion, selection, bubbling, shell, heap, quick row

#include #include #include using namespace std;void swap (int a[], int i, int j); void Insert_sort (int a[], int n) {for (int i = 1; i =inc&&temp 0; i--) {for (int j = 1; j i; j--) {if (A[j] = r) {return;} int middle = (L + R)/2;merge_sort (A, L,

Java calls the shell to get the return value

Transferred from: http://blog.csdn.net/tengdazhang770960436/article/details/120148391.shell file return.shEcho 1Echo 2Echo 32.java file Test.java[Java]View PlainCopy Import Java.io.BufferedInputStream; Import Java.io.BufferedReader; Import

Shell arrays and dictionaries

Shell arrays and dictionaries#!/bin/bashecho "Shell definition dictionary" #必须先声明declare-A dicdic= ([key1]= "value1" [key2]= "value2" [key3]= "Value3") # Print the specified key Valueecho ${dic["Key1"} #打印所有key值echo ${!dic[*]} #打印所有valueecho ${dic[*]

Sorting algorithm--shell sorting

PrincipleDivides the sorted array into sub-sequences (this depends on the originally set step value), then inserts the sequence directly between the individual sub-sequences, and then the increment (that is, the step value) and then inserts the sort,

Simple shelling Tutorial Note (---hand off exe32pack shell

This note is for the early ximo of the shelling Basic video tutorial, organized notes. the tools used in this note:http://download.csdn.net/detail/obuyiseng/9466056Exe32pack1.ESP Law1, the program loaded into the OD, found that there is a large

Total Pages: 541 1 .... 501 502 503 504 505 .... 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.