2019年11月3日

摘要: 1.test 测试范围:整数,字符串,文件 表达式结果为真,则test的返回值为0,否则为非0。 表达式结果为真,则变量$?的值为0,否则为非0 (一)字符串 判断是否相等: test $str1 == $str2 ;echo $? test $str1 != $str2;echo $? 判断是否有 阅读全文
posted @ 2019-11-03 19:06 happygril3 阅读(130) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2019-11-03 15:21 happygril3 阅读(88) 评论(0) 推荐(0)
摘要: #! /bin/bash read -t 30 -p "please input your name:" name echo $name read -t 30 -p "please input your name and age:" name age echo $name echo $age read -t 30 -sp "please input you password:" pwd echo 阅读全文
posted @ 2019-11-03 15:06 happygril3 阅读(138) 评论(0) 推荐(0)
摘要: (1)获取参数:从shell文件传来参数,调用:$1,$2,$3 load_date=$1 clearn_date=`date -d"$2 day ago $load_date" +%Y-%m-%d` local_path=$3 (2)执行HIVE: hive -e 后面是直接用双引号拼接hives 阅读全文
posted @ 2019-11-03 09:34 happygril3 阅读(130) 评论(0) 推荐(0)
摘要: (1)今天 date -d "now" +"%Y-%m-%d" (2)昨天 date -d "yesterday" +"%Y-%m-%d" date -d "1 day ago" +"%Y-%m-%d" (3)具体日期的前几天 date -d "n days ago $具体日期" +%Y-%m-%d 阅读全文
posted @ 2019-11-03 09:16 happygril3 阅读(84) 评论(0) 推荐(0)

导航