- 论坛徽章:
- 0
|
原帖由 lovelyarry 于 2006-3-3 10:42 发表
为什么不用printf那?
printf "press any key to continue..."
read
echo "thank you"
我觉得也是.只要功能能实现就可以了,用不着那么诡异.
- /tmp# more readir
- #!/bin/bash
- printf "Config file directory [default is:/etc/prog1]: "
- if [ "$config_dir" = "" ]
- then
- read config_dir
- fi
- if [ "$config_dir" = "" ]
- then
- config_dir=/etc/prog1
- fi
- echo $config_dir
- /tmp# sh readir
- Config file directory [default is:/etc/prog1]:
- /etc/prog1
- /tmp# sh readir
- Config file directory [default is:/etc/prog1]: /opt/ibm/websphere
- /opt/ibm/websphere
- /tmp#
复制代码 |
|