![](https://img-blog.csdnimg.cn/20190927151043371.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
4.linux
国民小跟班
喜欢总结、极简主义、观点分享、懒人懒办法系列
展开
-
linux复习2(shell脚本3)
1.设计一个shell程序,判断一文件是不是块或字符设备文件,如果是将其拷贝到/root/mydev目录下。 1 echo -e "please input a filename" 2 read filename 3 if [ -c $filename ];then 4 cp $f...原创 2019-12-13 20:11:07 · 249 阅读 · 0 评论 -
linux复习2(shell脚本)
1. 编写shell脚本,逆序打印一行文本,如输入“welcome”,则输出为“emoclew”。 1 read -p "Please input a String: " str 2 len=${#str} 3 for((i=$len-...原创 2019-12-11 12:54:30 · 735 阅读 · 0 评论 -
linux复习1(shell脚本)
一、习题 1. 脚本编程:求200内的质数,并输出。 1 for((i=2;i<=200;i++)) 2 do 3 flag=1 4 for((j=2;j<i;j++)) 5 do 6 model=$[$i%$j] ...原创 2019-12-09 19:14:28 · 393 阅读 · 1 评论