Linux shell logical operators, logical expressions

The logical operators of the shell involve the following types, so as long as the appropriate choice, can solve our many complex judgments, to achieve a multiplier effect.First, the logical operator Logical Volume Label Express

Linux Shell reads a line

Linux Shell reads a lineMethod OneBy specifying IFS--Internal Field Separator , by IFS default , you can set a value in the script IFSDEMO 1$cat t1.txt abcfd $cat test_IFS.sh #! /bin/shIFS="c"for LINE in `cat t1.txt`do echo $LINEdone$sh

(Linux shell) Chapter II-The Joy of command (i)

Article from my personal blog: (Linux shell) Chapter II-The Joy of command (a)In the previous chapter we described some of the syntax that we need to be aware of in the Linux shell, and then we begin to understand the common commands of the Linux

Use shell commands to obtain IP addresses

1. Obtain the IPv4 address of a single network adapter. The method is as follows:Method 1:$/Sbin/ifconfig ethx | awk '/inet ADDR/{print $2}' | cut-F2-d ":"Method 2:$/Sbin/ifconfig ethx | awk '/inet ADDR/{print $2}' | awk-F: '{print $2 }'Method

Regular Expression metacharacters in Shell

'.' Matches any character '*' Specifies that * can be used repeatedly for any number of times. '^' Starts with a string '$' String end '. *' Any number of characters '\' Escape Character '[...]' Matches any character '[^...]'

Configure the ddns dynamic domain name of the peanut shell on the tomato Router

Recently, Google was completely banned, and the code hosted on the Google SVN server was inaccessible.It's a waste of things. I unloaded the slow Win8 running in my old notebook, installed Ubuntu, mounted the svn server, and managed some personal

Understanding and learning Shell

Understanding and learning Shell The shell version used in Linux is called "Bourne again shell (BASH)". This shell is an enhanced version of the Bourne shell and developed based on the GNU architecture.BASH Shell functions 1. Command memory function:

Shell programming (12) --- add user example

[[email protected] Learn]# cat useradd-final.sh #!/bin/bash#DEBUG=0ADD=0DEL=0help() {echo "Usage: $(basename $0) -v | --verbose | --add user1,user2,... | --del user1,user2,... | -h | --help"}while [ $# -ne 0 ]docase $1 in-h | --help )helpexit 0;;-v |

Shell script basics ----- For Loop

Format For name in list Do Loop body Done Example: List the usernames, uid, and shell in the/etc/passwd file, Row 1, 3, 6, and

Shell script Exercise 3

Scan all hosts in the network segment. Online hosts are displayed in green. Offline hosts are displayed in red; Finally, the numbers of online and offline hosts are displayed respectively; In order to practice shell, only the for loop is used here,

Typeset shell usage

  Typeset can be used to set variable attributes, such as case, width, and left-right alignment. When typeset is used to change the attributes of a variable, this change is permanent, the following uses KSh as an example to demonstrate the

Shell task control

Tag: Shell Shell task control terms: (1) Foreground task: Run in shell. The shell prompt does not appear before the task is completed, so other tasks cannot be run at the same time. (2) Background task: Run in shell, but not exclusively in shell.

Shift usage in shell programming

Location parameters can be used shiftCommand left shift. For example shift 3Indicates the original $4Change $1, The original $5Change $2And so on. $1, $2, $3Discard, $0Do not move. Without Parameters shiftThe command is equivalent shift 1. Very

[Shell] basic bash functions: wildcards and special symbols

/* Configure /*------------------------------------------------------------------------------------------- @ Blackeye poet Optional --------------------------------------------------------------------------------------------*/ I. wildcard

Shell Concurrency Control

Method 1: #!/bin/bashc=0for i in `seq -w 18 31`;do while [ $c -ge 3 ];do c=$(jobs -p |wc -w) sleep 1s done bash run_cal_us_tmp.sh 201407$i & #echo "`sleep 5s`haha" & c=$(jobs -p |wc -w)done Advantages: easy to implement Disadvantage: If

Shell removes empty rows

There are many blank lines after extracting the log files to be viewed recently, which is not conducive to the comparison of previous files. In order to be backward compatible, only empty lines can be deleted when obtained. I googled myself and used

Shell script checks the program. If it fails, restart the program.

The script is as follows: #! /Bin/sh # Name of the process to be checked progress_name = "heihu_server" # ------------------------------- # function: checkprogress # function: Check whether a process exists # parameter: $1 --- Name of the process to

Shell Common commands and Process Control

Three types of commands can be used in shell scripts: >>> Unix Commands Although any Unix command can be used in shell scripts, some more common commands are used. These commands are usually used for file and text operations. Common command

Shell script for collecting system information

#! /Bin/bashIP = $ (ip A | grep "Inet" | awk '{print $2}' | awk-F/'{print $1}' | grep-V 127.0.0.1 | awk' begin {rs = '\ n'} {$1 = $1; print $0} '| SED's //,/G') # retrieve all IP addresses except 127.0.0.1 and separate them with commas (,).Hostname =

Shell operations of HDFS

Option name Format Description -Ls -Ls View the current directory structure of the specified path -LSR -LSR Recursively view the directory structure of a specified path -Du -Du Measure the file

Total Pages: 541 1 .... 267 268 269 270 271 .... 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.