How to write a robust bash script (experience sharing) _linux Shell

Shell scripts can have a very large impact when they run an exception. This article describes some of the techniques that make bash scripts robust. Using Set-u How many times did the script crash because there was no initialization of the

Error:couldn ' t connect to server 127.0.0.1:27017 Src/mongo/shell/mongo.js:91__js

Recently began to learn MONGO in the window installation has mastered, the operation is not difficult, the use of the work or the use of Linux in more. However, refer to some documentation after the installation is complete. Found a header error at

Linux Bash Shell Starter Tutorial (reprint) __linux

Introduction to Shell Script (bash) As is known to all, Unix is famous for its gadgets, using a number of simple gadgets to accomplish a job that would otherwise require a lot of software development, making UNIX the ideal system platform for many

Linux Shell Learning: How to iterate through the lines, words, and characters in a file

Iterating and traversing the lines, words, and characters in a file is a very common operation when you are working on a text file. Using a simple loop for iterations, plus a redirection from stdin or files, is the basic way to iterate through the

Raspberry Pi Learning Note--shell script operation Gpio

0. PrefaceRaspberry Pi can be painless starter Linux, which controls the Raspberry Pi gpio through command and shell scripting. With this article you can familiarize yourself with multiple Linux commands and familiarize yourself with the shell

Shell Special variables: Shell $, $#, $*, $@, $, $$, and command-line arguments

ShellSpecial variables: Shell $, $#, $*, [email protected], $?, $$ and command line argumentsAs already mentioned, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special

"Update complete" Linux command line and Shell script Programming Daquan (3rd edition) reading notes 21-26 chapters

21st Chapter SED AdvancedN: Add the next line in the data flow to create a multiline group (multiline) to process.D: Delete the first row in a multiline group.P: Prints the first row in the multiline group.Sed '/header/{n; d} ' Data.txtFirst match

Linux/unix shell script monitors disk free space

A shell script that monitors the disk's free space under Linux is essential for a system administrator or DBA. Here is a sample of the shell script that monitors disk space space for your reference.1. Free space for monitoring disk shell

Shell script, extract IP address and subnet mask, and check out network IP address information.

#提取IP地址和子网掩码 [[email protected]~]#ifconfigeth0|grep 'inet Addr'|awk-F'[ :]+' '{print $4 "/" $8}'192.168.16.110/255.255.255.0[[Email protected]~]# #查外网IP地址 [[email protected]~]# curl-s Ipecho.net/plain;Echo114.93.99.39#查外网ip地址是什么宽带[[email protected] ~

Shell Special variables: Shell $, $#, $*, $@, $, $$, and command-line arguments

Variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such variables are called special variables.For example, $ represents the ID of the current shell

${##%%} in the shell stands for what, memo

#!/bin/bashA=aigo.goto.aigo.gotoEcho ${a#*go}Echo ${a##*go}Echo ${a%.*}Echo ${a%%go*}Execution results. Goto.aigo.gotoToAigo.goto.aigoAiThe memo is as follows:#* string--from left to right the first occurrence of the "string" in variable a (most

Reverse Shell Cheat Sheet

Use Netcat to listen locally to an allowed legitimate port, such as 80/443 [Email protected]:~# nc-nvlp 80nc:listening on:: ... nc:listening on 0.0.0.0 80 ... Note: If you are attacking a bouncing machine inside a NAT routing network, then you need

[9-13] Shell Series 3--branching structure if and case statements

The purpose of this paper is to review 3 kinds of IF statements and case multi-branch structure statements that the shell implements for branching, and to supplement the execution efficiency of if and case.Knowledge Reserve The

[Batch processing Tutorial shell]002.linux Common command Daquan

This time the collection is a relatively basic Linux command, in fact, the Linux command does not have to remember each, as long as the use of the command can be consulted to see the use of. System Information The processor

Shell Script Learning 15 Shell printf command: Format output statement

The printf command is used to format the output and is an enhanced version of the echo command. It is a finite variant of the C-language printf () library function, and is somewhat different in syntax.Note: printf is defined by the POSIX standard,

Shell programming Control structure: expr, let, for, while, until, shift, if, case, break, continue, function, select

1. expr computes the integer variable valueS= ' Expr 2 + 3 'The arithmetic symbol and the parameter must have the space separate;2. Let command let s= (2+3) echo $s 3, for statement For variable in list

VNCSERVER,SSH Secure Shell client,window remote Control Linux

1.VNC remote connection to Linux graphical desktop2.SSH Secure Shell Client connection to Linux terminal3. Set FTP and Linux transfer files1.VNC remote connection to Linux graphical desktopRun under CentOS:Yum-y instll VNC Vnc-serverAfter running,

$ CD 'dirname $ 0' and PWD %/* special usage of shell Variables

It is meaningless to simply execute $ CD 'dirname $ 0' in the command line state. Because it returns "." of the current path ".". This command works only when it is written in a script file. It returns the directory where the script file is stored

Shell knowledge point supplement (2)-redirection /;,&&, |/pipeline command/grep/sort/uniq/WC/Tee/TR/COL/join/paste/expand/split /-

1. Redirection 1. Standard input (stdin): code 0, use 2. standard output (stdout): the code is 1, use> or>;3. Standard Error output (stderr): Code 2, Use 2> or 2>; Eg: Yee @ LOONG :~ $ Ifconfig> 1.txtYee @ LOONG :~ $ Vim 1.txtYee @ LOONG :~ $ LS-Al 2

Shell quotation marks, backquotes, double quotation marks, and backslash

How to interpret quotation marks in Unix Shell Shell can recognize four different types of leading characters: single quotes character 'double quotation marks character "backslash character \ backquotes character '1. Single quotes ('') Howard @ 0

Total Pages: 541 1 .... 15 16 17 18 19 .... 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.