
shell
哭着改bug
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
给docker容器中的mysql做定时数据备份
给docker容器中的mysql做定时数据备份原创 2023-09-18 11:33:33 · 672 阅读 · 0 评论 -
shell脚本中报binary operator expected错
shell脚本中遇到的坑如下代码,报错【binary operator expected】这个错说什么期望二进制运算符,没搞懂# get dateif [ -z $1 ]; then echo 'no date set, exit now' exit 1fid1=$(date -d "$1" +%Y-%m-%d" "%H:%M:%S)if [ -z $2 ]; the...原创 2020-01-20 09:57:50 · 24842 阅读 · 4 评论 -
shell脚本批量修改文件后缀
案例#!/bin/basholdext="txt"newext="sh"dir=$(eval pwd)for file in $(ls $dir | grep .$oldext) do name=$(ls $file | cut -d. -f1) mv $file ${name}.$newext done原创 2020-01-06 15:12:47 · 670 阅读 · 0 评论 -
shell脚本中单双引号问题
在Shell脚本开发过程中,针对变量的单引号(‘)和双引号(“)都是有应用场景的,根据我的经验总结起来就是:获取变量值的时候就使用双引号(“),这是基本用法。如果是在脚本中要编写一个新的脚本,同时这个新的脚本中还需要包含变量,你就可以选择使用单引号(‘)了,特别是生成一个临时的expect脚本时,单引号(‘)就会经常使用到的。sqoop import \--connect \...原创 2020-01-06 09:49:13 · 770 阅读 · 0 评论 -
shell脚本传递日期参数的处理
传递的时间参数为:./sqoop_member_test2.txt “2019-06-28 00:14:05”#!/bin/bashd1=$(date -d "$1" +%Y-%m-%d" "%H:%M:%S) //将时间赋值给变量if (date > "$d1")then echo "小于当前时间"else echo "大于当前时间"fiecho "$d1 ...原创 2020-01-03 14:28:52 · 5700 阅读 · 0 评论