2017年8月24日

linux shell获取键盘输入

摘要: linux shell从键盘获取输入 代码1: #!/bin/bash #提示“Input your choice:”,把用户的输入保存入变量choice_user中read -p "Input your choice:" choice_userecho "your choice:${choice_ 阅读全文

posted @ 2017-08-24 10:27 kingofyz 阅读(11505) 评论(0) 推荐(0)

linux shell创建目录、遍历子目录

摘要: 1、创建目录 代码1: #!/bin/bash#如果没有tmp_dir目录则创建static_dir="/web/fyunw.com/static"if [ ! -d $staic_dir ]; then sudo mkdir -p -m 755 $static_dir echo "sudo mkd 阅读全文

posted @ 2017-08-24 10:18 kingofyz 阅读(18607) 评论(1) 推荐(0)

linux shell写入单行、多行内容到文件

摘要: 1、单行文本 #! /bin/bashecho 'hello world' > filename.txt 2、多行文本 代码1: #! /bin/bashcat>filename.txt<<EOFhello world代码改变世界 Coding Changes the World100 \$ 她买了 阅读全文

posted @ 2017-08-24 10:06 kingofyz 阅读(43062) 评论(0) 推荐(4)

导航