128

Shell练习(十)-kindy个人博客

 7 years ago
source link: http://blog.51cto.com/11924224/2083246
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
习题1:用户交互脚本要求:写一个脚本,执行后,打印一行提示“Pleaseinputanumber:”,要求用户输入数值,然后打印出该数值,然后再次要求用户输入数值。直到用户输入”end”停止。参考答案:#!/bin/bash#date:2018年3月5日while:doread-p"Pleaseinputanumber:(endforexit)"nnum=`echo$n|sed-r's/[0-9]

Recommend

  • 94
    • blog.51cto.com 7 years ago
    • Cache

    Python练习(day7)-沐梓琼-51CTO博客

    Python练习(day7)

  • 96
    • blog.51cto.com 7 years ago
    • Cache

    Python练习(day9)-沐梓琼-51CTO博客

    练习1、模拟抢车票(进程同步锁)代码1:(并发运行,效率高,但竞争同一文件,数据写入错乱)frommultiprocessingimportProcessimporttime,json,randomdefsearch():dic=json.load(open('db.txt'))print('剩余票数%s'%dic['count'])defget():dic=json.load(open('db.

  • 175
    • blog.51cto.com 7 years ago
    • Cache

    Shell练习(九)-kindy个人博客

    习题1:找规律打印数字要求:请详细查看如下几个数字的规律,并使用shell脚本输出后面的十个数字。            10 31 53 77  105 141 …….提示:相邻两个数差值的差值有规律参考答案:习题2:封IP要求:根据web服务器上的访问日志

  • 126
    • blog.51cto.com 7 years ago
    • Cache

    Shell基础知识-kindy个人博客

    shell介绍:shell命令语言解释器,执行命令从标准输入读取或从一个文件中读取。通过用户输入命令,和内核进行沟通!简单点理解就是:用户直接面对的不是计算机硬件而是shell,用户把指令告诉shell,然后shell再传输给系统内核,接着内核再去支配计算机硬件去执行各...

  • 77

    习题1:统计数字并求和要求:计算文档1.txt中每一行中出现的数字个数并且要计算一下整个文档中一共出现了几个数字。参考答案:习题2:统计网卡流量要求:写一个脚本,检测你的网络流量,并记录到一个日志里。需要按照如下格式,并且一分钟统计一次(只需要统计外网...

  • 36
    • www.tuicool.com 5 years ago
    • Cache

    shell语法练习

    shell语法练习 变量的定义和使用 编写shell脚本,第一行是 #!/bin/bash 代表是个shell脚本 输入参数: 形式 说明 $0 当前程序的名称 $n 程...

  • 6

    Jager · 6月19日 · 2014年shell练习脚本 199次已读此文将整理一些简单实用、有趣易学的

  • 4

    正则表达式练习 原创 小小ITa 2022-07-15 08:33:25...

  • 5

    sed命令练习 精选 原创 1、匹配root行,加-e为扩展正则表达式,不加为基本...

  • 10

    磁盘文件练习 精选 原创 1、dd命令格式 dd if=/PATH/FROM/SRC of=/PATH/TO/DEST bs=# count=# 常用选项: i...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK