Four of Shell Learning notes (integer operations)

Tag:shell    integer arithmetic     operator     The arithmetic operator shell only supports integer operations, and most common arithmetic operations are used in conjunction with the Shell's built-in command let. +-*/% * * (Power operation) + = = *

The use of the eight turns of the Linux shell

First, the file code"Steering" means that the standard input (such as the keyboard) should be read by other files, and the result should be displayed on standard output (such as screen) and output to other files. The concept of file descriptor is

Shell calculation string length method and speed comparison

Tag: Shell calculates string length chars= ' seq-s '; echo $chars 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32  33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

Some of the shell commands that you use

"System common Commands"passwd [hostname] Change PasswordUSERADD [hostname] adding usersSu- switch to root userSSH [hostname] SSH connectioncd [directory] into the directory directorysudo chown [username] assigns appropriate permissions

Hbase Shell operations (full record)

1. Enter the HBase command line>hbase ShellExit command line>quit2. Create a table>create ' users ', ' user_id ', ' address ', ' info '3. View All Tables>list4. View table Structure>describe ' users '5. Delete the table:>disable ' users ' >drop '

Shell script--dns Automatic deployment

Detailed description View:(a) Play with Me Linux network services: DNS service--bind (/etc/named.conf,/var/named) settings implementation and interpretation1#! /bin/Bash2ip="10.10.10"3rip="10.10.10"4dn="gr.org"5Name="10.10.10.10"6 7Cat

Shell Programming---File testing and special variables

I. Arithmetic operations 1. Let arithmetic operation expressionLet c= $A + $B2. $[arithmetic operation expression]c=$[$A + $B]3, $ (arithmetic operation expression)c=$ (($A + $B))4, expr arithmetic expression, the expression in the operands and

Shell Programming---condition judgment

I. Condition judgment of shell programming1. Integer testA. Expressions for conditional tests[Expression][[Expression]]Test expressionB. Integer comparison-EQ: Tests whether two integers are equal, such as $A-eq $B-ne: Test whether the two integers

Linux system-shell Programming-several shell scripts

Linux System-shell programming-several shell scriptsone kill the userkilluser.sh#!/bin/sh# The script to kill login userUser_name= "$"/bin/ps aux | /bin/grep $user _name | /bin/awk ' {print $} ' >/tmp/temp.pidKill_id= ' Cat/tmp/temp.pid 'For PID in

Linux shell adds or subtracts an hour or a minute from the specified date

Subtracts the specified day from the specified date[Email protected] init_env]$ date-d "20150416 3 days" + "%y%m%d%h"2015041912Adds the specified hour to the specified date[Email protected] init_env]$ date-d "20150416 3 hour" +

Shell introduction and Getting Started

1. What is bash?Bash is a Unix shell written for the GNU program and is the default shell used by many Linux platforms.The shell is a command interpreter, an insulating layer between the operating system kernel and the user. At the same time, the

Shell Basics Exercises

"Shell Script Basics"Create a script#vim 1.sh*********************#! /bin/bashecho "Hello world!"*********************#chmod +x 1.sh#sh 1.shHello world!Extensions and command extensions still work within double quotation marks.#echo "Can I have a

Writing elegant shell scripts (eight)-date formatting

1. Convert the date format to a timestampGet current time: Currenttime= 'date'+%y-%m-%d%h:%m:%s' Result: 2015-04-13 11:15:43Convert current time to timestamp: timestamp= 'date'$curtime ' +%s ' Result: 1428894966 2. Convert the timestamp to a date

Linux issue: Crontab a problem with relative paths when executing shell scripts, not recognized.

Problem Description: The direct execution shell script in Linux can find the file with a relative path, but if you execute the shell script through the scheduled task crontab, you cannot find the file by relative path!Example:Shell script file Code ~

Shell Scripting Practices

1. The script determines whether the command output is empty(1) Determine if the string is emptyIf ["$str" = ""]If [x "$str" = x]If [-Z ' $str '] (-n is not null)Note: You have to double quotation marks, or some commands will be error, form a good

Shell Summary (while)

#!/bin/bashwhile ifs=: Read name1 name2 name3 name4#ifs is the split symbol specified when reading from a file, assigning the contents of a to the corresponding variable in separate sections. Do echo $name 1 ' | ' $name 2 ' | ' $name 3 ' | ' $name 4

Bash Shell read file line and substring

#read Onefile Line by line forLineinch$(Cattest1.txt); Do Echo$line; Done;# whileReadSplitLine by Space whileRead Line Do forWordinch$line Do Echo$word Done; Donetest1.txt#string Splitor substring input=type=ABCDEFGEcho$input, #get

Insert sort and shell sort (Hill sort)

1. the process of inserting a sort is like the way we usually play poker to get the cards inserted, constantly inserting the cards that have been taken out into place.The initial ordered interval size of the insertion sort process is 1, the first

Use shell for mathematical operations and shell mathematical operations

Use shell for mathematical operations and shell mathematical operations Availablelet,(()),[]Basic arithmetic operations, advanced operationsbcMore efficient. Let's look at the code and make the output clear.Let [Zhengweiwu ~] $ No1 = 4 [zhengweiwu ~

Shell learning-awk getting started

Shell learning-awk getting started I. awk application scenarios Format data or extract records from a large text file Ii. Usage Command Line$ Awk [-F field-separator] 'commands' input-file (s)Commands is a real awk command[-F domain delimiter] is

Total Pages: 541 1 .... 319 320 321 322 323 .... 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.