Giter Club home page Giter Club logo

linux-shell--practice's Introduction

Linux-shell

简单基础的shell脚本标准开头信息
#/bin/bash
#===============================================
#FILE:文件
#USAGE:用法
#DESCRIPTION:描述
#OPTIONS:选项
#REQUIREMENTS:要求
#BUGS:已知错误
#NOTES:备注
#AUTHOR:作者
#ORGANIZATION:公司或组织
#CREATED:创建时间
#REVISION:修订版
#==============================================
显示时间:time=$(date '+%Y/%m/%d %H:%M:%S')

1.一个点点进度条

user@Ubuntu:~$ ./8.4.1.sh
./8.4.1.sh: please wait....10+0 records in
10+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0844163 s, 1.2 GB/s
...done.

2.判断邮箱等正则表达式

user@Ubuntu:~$ ./9.1.4.sh
Input a email,Please:[email protected]
This email address looks fine:[email protected]

3.case_选项模板函数

user@Ubuntu:~$ ./command.sh
Backup utility
Usage: command.sh {sql|sync|snap}
sql : Run MySQL backup utility.
sync : Run web server backup utility.
Input a command,Please:sync
Running backup using rsync tool...
shopt -s nocasematch # 打开Bash的开关,忽略大小写
参数:-u关闭

4.输入的参数相关函数

user@Ubuntu:~$ ./connand.sh one two there
Listing args With $*:
Arg #1 = one
Arg #2 = two
Arg #3 = there

linux-shell--practice's People

Contributors

xuan-phoenix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.