ZKX's LAB

编写一个shell脚本命令 linux下利用test命令的判断文件属性的功能编写一个shell脚本

2021-04-23知识2

linux下利用test命令的判断文件属性的功能编写一个shell脚本 对于文件是否有读写权限,这个没有涉及bin/bashread-p\"please input the file name:\"fileif。n\"$file\"];thenecho please input the file name pleaseexit 0fils$file>;/dev/null 2>;&1if[$?eq 0]thenecho file existcp$file$file.bakvi$fileelseecho file not exist。fi

编写一个shell脚本程序,从命令行输入10个数 bin/bashall=$if[$#-ne 10];thenecho error|tee-a/tmp/errexit 1fisum=1for i in$alldoif[$i-le 0];thenecho error|tee-a/tmp/errexit 1elsesum=`expr$sum \\*i`fidoneecho$sum

编写一个shell脚本程序 result=0for num in$doresult=$((result+num))doneecho$result

随机阅读

qrcode
访问手机版