shell:select 用法
来源:互联网 发布:河南农业大学软件学院 编辑:程序博客网 时间:2024/05/12 12:45
1)选择操作系统
#!/bin/sh
echo "What is your favourite OS?"
select var in "Linux" "Gnu Hurd" "Free BSD" "Other";
do
echo "You have selected $var"
break
done
2)修改文件权限
#!/bin/bash
echo "This script can make any of the files in this directory private."
echo "Enter the number of the file you want to protect:"
PS3="Your choice: "
QUIT="QUIT THIS PROGRAM - I feel safe now."
touch "$QUIT"
select FILENAME in *;
do
case $FILENAME in
"$QUIT")
echo "Exiting."
break
;;
*)
echo "You picked $FILENAME ($REPLY)"
chmod go-rwx "$FILENAME"
;;
esac
done
rm "$QUIT"
- shell:select 用法
- shell select用法示例
- Shell编程中select用法
- shell -select
- shell select
- select用法
- select()用法
- select()用法
- select()用法
- select用法
- select 用法
- select用法
- select用法
- select 用法
- select用法
- select 用法
- select用法
- select用法
- 据说是11年度最佳代码
- 22个很棒的jQuery文件上传插件
- 隔行模拟摄像头缺点
- 如果你在Windows下用putty来远程连接Linux发现乱码请用下面的方法解决:
- hdu 1690 Bus System--floyd
- shell:select 用法
- 头文件与之实现文件的的关系
- mutable关键字
- 哪里可以下载到android cts
- 11款用于优化、分析源代码的Java工具
- java连接oracle
- 测试指令和位测试指令的用法-TEST
- 利用树统计单词出现的频率
- 内存的堆分配和栈分配 & 字符数组,字符指针,Sizeof总结