摘要: 代码: #!/bin/bash ls=$(ls) echo $ls whoami=`whoami` echo $whoami 执行结果: [os-××××××××101z ~]$ sh cmd2.sh 1.py 2020-03-16-b020 AllocationReq_0030_202003061 阅读全文
posted @ 2020-03-18 17:20 逆火狂飙 阅读(1187) 评论(0) 推荐(0)
摘要: 树形查询一般用于上下级场合,使用的特殊sql语法包括level,prior,start with,connect by等,下面将就实例来说明其用法。 表定义: create table tb_hierarchy( id number(4,0) primary key, name nvarchar2( 阅读全文
posted @ 2020-03-18 15:08 逆火狂飙 阅读(1436) 评论(1) 推荐(0)
摘要: 某目录下有个test.txt,内容如下: www.stg.comwwstgcom 如果我这样去查找: $ grep '.stg.' test.txtwww.stg.comwwstgcom 发现第二个匹配与预想不符,之所以找出来是因为grep支持正则式,"."可以和任意字符匹配。 因此要用下面的方式去 阅读全文
posted @ 2020-03-18 14:19 逆火狂飙 阅读(218) 评论(0) 推荐(0)
摘要: 代码: #!/bin/bash hostname=$(hostname) #调用hostname命令获取主机名放入变量hostname中 #echo $hostname if [ `echo ${hostname} | grep "\.stg\."` ]; then #如果hostname变量中含有 阅读全文
posted @ 2020-03-18 09:43 逆火狂飙 阅读(525) 评论(0) 推荐(0)