您所在位置: 网站首页 / 文档列表 / linux/Unix相关 / 文档详情
Linux配置与管理教程书上原脚本.doc 立即下载
上传人:yy****24 上传时间:2024-09-07 格式:DOC 页数:7 大小:18KB 金币:16 举报 版权申诉
预览加载中,请您耐心等待几秒...

Linux配置与管理教程书上原脚本.doc

Linux配置与管理教程书上原脚本.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

16 金币

下载文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

01.sh#!/bin/bash#program#thisprogramshows"Helloeveryone!welcometotheworldofshellscript"inyourscreen#History:#2013/03/25ccfirstreleaseecho"Helloeveryone!"echo"welcometotheworldoftheshellscript!"02.sh#!/bin/bash#program#thisprogramshows"Helloeveryone!welcometotheworldofshellscript"inyourscreen#History:#2013/03/25ccfirstreleaseread-p"pleaseenteryourname:"nameecho"Hello$name,"echo"welcometotheworldofshellscript!"03.sh#!/bin/bash#program:#letuserinputafilename,theprogramwillsearchthefilename#1)exist?2)fileordirectory?3)filepermissions#让用户输入文件名,并且判断用户是否真的有输入字符串echo-e"theprogramwillshowyouthatthefilename'stypeandpermissionwhichyouinput."read-p"inputafilename:"filenametest-z$filename&&echo"youmustinputafilename!"&&exit0#判断文件是否存在,如果不存在则结束脚本test!-e$filename&&echo"thefilewhosenamed$filenameisnotexit"&&exit0#判断是否是普通文件,如果不是则结束脚本test!-f$filename&&echo"thefilenameisnotaregularfile"&&exit0#文件存在且为普通文件,则开始判断文件的属性perm=""test-r$filename&&perm="$perm""&""readable"test-w$filename&&perm="$perm""&""writable"test-x$filename&&perm="$perm""&""executable"#输出判断信息echo"theregular&filename'spermissionis:$perm."04.sh#!/bin/bash#program:#thisprogramshowuser'schoiceecho"ifyouwanttocontinue,pleaseinputY"echo"ifyouwanttointerruput,PleaseinputN"read-p"pleaseinputyourchoice:"choice["$choice"=="Y"-o"$choice"=="y"]&&echo"ok,continue!"&&exit0["$choice"=="N"-o"$choice"=="n"]&&echo"ok,interrupt!"&&exit0echo"idon'tknowwhatyourchoiceis"&&exit005.sh#!/bin/bash#program#thisprogramwilltellyouthedefaultvariablesusedinscriptecho"thescriptnameis$0"echo"thefirstparameteris$1"echo"thesecondparameteris$2"echo"thethirdparameteris$3"echo"totalparameternumberis$#"echo"thewholeparameteris"$@""06.sh#!/bin/bash#program#thisprogramshowuser'schoiceecho"ifyouwanttocontinue,pleaseinputY"echo"ifyouwanttointerruput,PleaseinputN"read-p"pleaseinputyourchoice:"choiceif["$choice"=="Y"-o"$choice"=="y"];thenecho"ok,continue!"exit0fiif["$choice"==
单篇购买
VIP会员(1亿+VIP文档免费下)

扫码即表示接受《下载须知》

Linux配置与管理教程书上原脚本

文档大小:18KB

限时特价:扫码查看

• 请登录后再进行扫码购买
• 使用微信/支付宝扫码注册及付费下载,详阅 用户协议 隐私政策
• 如已在其他页面进行付款,请刷新当前页面重试
• 付费购买成功后,此文档可永久免费下载
年会员
99.0
¥199.0

6亿VIP文档任选,共次下载特权。

已优惠

微信/支付宝扫码完成支付,可开具发票

VIP尽享专属权益

VIP文档免费下载

赠送VIP文档免费下载次数

阅读免打扰

去除文档详情页间广告

专属身份标识

尊贵的VIP专属身份标识

高级客服

一对一高级客服服务

多端互通

电脑端/手机端权益通用

手机号注册 用户名注册
我已阅读并接受《用户协议》《隐私政策》
已有账号?立即登录
我已阅读并接受《用户协议》《隐私政策》
已有账号?立即登录
登录
手机号登录 微信扫码登录
微信扫一扫登录 账号密码登录

首次登录需关注“豆柴文库”公众号

新用户注册
VIP会员(1亿+VIP文档免费下)
年会员
99.0
¥199.0

6亿VIP文档任选,共次下载特权。

已优惠

微信/支付宝扫码完成支付,可开具发票

VIP尽享专属权益

VIP文档免费下载

赠送VIP文档免费下载次数

阅读免打扰

去除文档详情页间广告

专属身份标识

尊贵的VIP专属身份标识

高级客服

一对一高级客服服务

多端互通

电脑端/手机端权益通用