
shell
木安
这个作者很懒,什么都没留下…
展开
-
SHELL 你应该知道的语法
#!/bin/sh #set -x echo -n "can you write device drivers? " read answer answer=`echo $answer | tr [a-z] [A-Z]` if [ $answer = Y] then echo "Wow, you must be very skilled" else echo "neither can i原创 2013-03-25 15:06:03 · 753 阅读 · 0 评论 -
shell中并,或的用法
if [ "${service_type}" = "A" -o "${service_type}" = "B" -a "${ftp_server}" = "Yes" ]; then ehco "wo shi $service_type" fi if [ "${ftp_server}" = "Yes" -a \( "${service_type}" = "B" -o "${servic原创 2013-03-14 11:18:09 · 1158 阅读 · 0 评论 -
linux读properties文件
function read_file { if [ $# -ne 2 ];then echo "you must put one parmes" exit 1 fi typeset file=$1 typeset key=$2 value=`awk -F= -v k=${key} '{ if ( $1 == k ) print $2; }' $file`原创 2013-03-11 13:27:27 · 7793 阅读 · 0 评论 -
获取linux服务器IP
function get_linux_ip { echo "start to read host ip" if [ -f /home/1.properties ];then echo "file is exsit" cd /home rm -rf 1.properties cd .. else echo "file is not exsit" cd /home原创 2013-03-11 17:00:50 · 1674 阅读 · 0 评论