摘要:
一、小括号( ) 1)作为局部变量作用符号 #!/bin/bash a=123 ( a=321; ) echo "$a" #a的值为123而不是321,因为括号将判断为局部变量 2)初始化数组 #!/bin/bash arr=(1 4 5 7 9 21) echo ${arr[3]} # get a 阅读全文
posted @ 2021-07-20 08:40
刘凯_tju
阅读(49)
评论(0)
推荐(0)
摘要:
1,# 注释字符(跟python注释字符#一样,可放开头,可放结尾) echo "The # here does not begin a comment." echo 'The # here does not begin a comment.' echo The \# here does not b 阅读全文
posted @ 2021-07-20 08:10
刘凯_tju
阅读(182)
评论(0)
推荐(0)
摘要:
1,定时任务一般放在 crontab-e 吊起的文件中 2,20,50 * * * * sh xx/yy.sh >xx/log/copy_test_data_log_$(date +\%Y\%m\%d_\%H\%M\%S) 2>&1 & 20,50 是每小时20分和50分各自执行一次 若20 是每小 阅读全文
posted @ 2021-07-13 20:20
刘凯_tju
阅读(186)
评论(0)
推荐(0)
摘要:
1,gg 返回文件开始2,G 文件末尾3,行号+G 转至行号处4,$ 光标移动到当前行的末尾5, 0 光标移动到当前行的开始6, /word 文档内搜索word n: 向后查找下一个。 N: 向前查找下一个。7,: set nu 设置行号8,dd 删除所在行,ndd删除往下n行 d1G 删除第一行到 阅读全文
posted @ 2021-07-13 20:19
刘凯_tju
阅读(28)
评论(0)
推荐(0)
摘要:
4, hadoop fs -ls XX | awk -F" " '{print $6"-"$7,$8}'|sort -k1 -r | awk -F" " '{print $2}'| head -n 1 第一步 -ls :显示出XX目录下所有目录以及其详细信息 drwxrwx--x+ - userna 阅读全文
posted @ 2021-07-13 20:12
刘凯_tju
阅读(88)
评论(0)
推荐(0)
摘要:
1,hadoop fs -cat /shining/temp.txt.gz | zcat | head -1hadoop fs -text /shining/temp.txt.gz | head -1 查看gz文件的第一行数据 参考资料:https://blog.csdn.net/java___bo 阅读全文
posted @ 2021-07-13 19:57
刘凯_tju
阅读(527)
评论(0)
推荐(0)
摘要:
#!/bin/sh source ~/.bash_profile; source /etc/profile; start_date="20190622" end_date="20190625" while [ "$start_date" -le "$end_date" ]; do yestertod 阅读全文
posted @ 2021-07-13 19:46
刘凯_tju
阅读(197)
评论(0)
推荐(0)
摘要:
#!/bin/bash source ~/.bash_profile; source /etc/profile; echo "start backup at $(date "+%Y-%m-%d %H:%M:%S")" crontab -l > crontab-backups #显示定时任务的内容 x 阅读全文
posted @ 2021-07-13 19:38
刘凯_tju
阅读(53)
评论(0)
推荐(0)
摘要:
2、shell 循环数组 #定义方法一 数组定义为空格分割 arrayWen=(a b c d e f) for var in ${arrayWen[@]}; do echo $var done 阅读全文
posted @ 2021-07-13 19:18
刘凯_tju
阅读(1996)
评论(0)
推荐(0)
摘要:
#!/bin/sh source ~/.bash_profile; source /etc/profile; start_date="20190622" end_date="20190625" while [ "$start_date" -le "$end_date" ]; do yestertod 阅读全文
posted @ 2021-07-13 18:02
刘凯_tju
阅读(119)
评论(0)
推荐(0)
浙公网安备 33010602011771号