Shell-Implemented Calculators

1 #!/bin/bash2 #FUNCTION Calculator3 #AUTHOR Wangbo4 #DATE 2015-09-26567 function Checknum ()8 {9 Expr + 0 &>/dev/null10Case $? Inch12 0)return $14;;15 *)16Read-t 50-p "Please input integer:" int18Check "$int"20Return "$int"2223;;Esac25}26function

Some simple instances of shell scripting

1. Word Frequency statisticsSed-e s/' [[:p UNCT:] '/'/g-e s/' [[:d igit:] '/'/g $filename | tr [A-z] [a-z] | Tr ' \ n ' | Tr ' \ n ' | Sed '/^$/d ' >>newfilename#干掉文本中的标点和数字#替换大小写#替换换行符为空格后再替换空格为换行符 (may not be necessary)#删除空行重定向到新文件Sort newfilename|

Shell Common Command Summary

Shell Common Command Summary1 ls command: List filesLs-la list all files and folders in the current directoryLS A * lists all files starting with the A letter in the current directory Ls-l *.txt Lists all files with the suffix txt in the current

Special characters in the shell

In addition to ordinary characters in the shell, there are many characters with special meanings and functions.1. Wildcard characters* : string of any length? : Matches any single character[]: Matches any one of these characters, for example:[ABC]

&& in Shell-linux | |

When the shell executes a command, it returns a return value that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed.    www.2cto.com   Sometimes the

A simple script that automatically creates shell scripts

Because I usually write some small experimental script, every time to write author,description and so very troublesome, then wrote such a script can create their own small script, code as follows, pure personal original, relatively rough, big God

20150913 Day Course Assignment (shell)

1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);2, summarize all the knowledge points involved in shell programming (such as: variables, grammar, command status, etc., to take the picture of

HBase Shell Related

1. Enter the HBase command line. /HBase Shell2. Basic commandsDisplay a list of tables in HBaseListQuerying all the information in the user table Scan' Users 'Clears the data Truncate in the user table ( equivalent to disable + drop + Create) '

The first time I took the shell

Here's how to take the shell with a little white. The first time I saw the word shell, and it was a task, to say Alexander.Background:http://www.tsqz888.com/xyfc/admin/Already have an account passwordFirst, backstage LoginSecond URL after add: admin/

Example of awk, if while in shell

1. If while command is written in one lineWhile read a b;do echo $a $b;d one 12 13 14Cat Aa.txt12 13 14if [[$i-eq 0 | | $i-eq 2]]; then env=10.79.40.146:80; else env=10.79.40.147:80; Fi2. Awk merges two filesAccount CdrCat AccountZhang San

Shell 99 Multiplication Table

#!/bin/bashfor I in {1..9}dofor j in ' seq 1 $i ' dom= ' echo "$i" "*" "$j" |bc ' Echo-n "$j" x "$i" = "$m" "" Doneecho "" DoneExecution Result:[Email protected] shell]#./99.sh1 x 1 = 11 x 2 = 2 2 x 2 = 41 x 3 = 3 2 x 3 = 6 3 x 3 = 91 x 4 = 4 2 x 4 =

Jenkins, Ant Ctomcat+shell reported Ant:command not Foun.

#!/bin/sh# Licensed to the Apache software Foundation (ASF) under one or more# Contributor license agreements. See the NOTICE file distributed with# This work for additional information regarding copyright ownership.# The ASF licenses this file to

Nginx under the log cutting shell

#!/bin/bashMkdir-p/data01/nginx_log/$ (Date +%y%m%d)cp/data01/nginx_log/access.log/data01/nginx_log/$ (date +%y%m%d)/access-$ (date +%y%m%d). log#先复制原来的正常访问日志Cat/dev/null

Getting Started with Shell programming

Getting Started with Shell programming~/.bash_history//root file path preserving the command history$HISTSIZE//History command variableSleep 100//Sleeping 100Sleep 200//sleeping 200CTRL + Z//pause command RunJobs//View tasksFG//Recall front DeskFG 2/

Two methods of shell automatic Interactive processing of commands

1:use ECHO-E Example Echo-e "n\np\n1\n\n+100m\nn\np\n2\n\n+1024m\nw\n" |fdisk/dev/vdb \ n represents a carriage return [Email protected] ~]# fdisk-l/DEV/VDBdisk/dev/vdb:8589 MB, 8589934592 bytesHeads, Sectors/track, 16644 cylindersUnits = Cylinders

Shell Special variables

$ represents the ID of the current shell process, which is the PID $echo $$Run results2934List of special variables variables meaning $0 filename of the current script arguments passed to

Shell syntax in makefile

Writing shell code in makefile is a bit weird, unlike shell syntax, and if you don't understand it, it can be confusing to see makefile. Here's a summary of some.1: The code that is the same line after the colon of the target item of the makefile

Linux Shell Demo

#!/bin/sh for in. /* do if test-d $p then touch $p ". Ok" if test-f $p "/busi.xml" then echo "Delete ${p}/ Busi.xml " rm $p"/busi.xml " fi for Z in $ (Find $p-name" *.zip ") do

Shell Foundation V: Array Preliminary

First, an array overviewArrays: Data StructuresData series, continuous multiple data, can be used to get related elements of the indexDeclaring an array:declare-e arraynameInitialization assignment:arrayname= ("STRING1" "STRING2" ... )Arrayname=

Shell Script-relational array

  1 ################################## #######################################     2 # file name:  muscian.sh  3 # author: dty  4 # mail: [email protected ]  5 # created time: wed 05 aug 2015 04:41:14 pm  Cst  6 ######################################

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