linuxshellSSHexepect Linux | shell与expect结合使用 在linux操作系统下,使用脚本自动化,一般由两种方案。方案一:telnet+ftp方案二:ssh+scp+expect。以下主要使用ssh+scp+expect为例进行说明使用方式。第一步:安装expect:yum -y inst... fishyoung Linux/Windows 2019-6-21 5054 0
正则表达式linuxshell=~ Linux | shell里if 判断条件正则表达式=~中引号问题 今天在脚本里运行if判断的时候,总是进不了对应的分支,检查正则表达式也没有错误。单独拿到shell里面执行还是显示没有匹配。比较奇怪,就搜了下,才发现是在=~ 后面的正则表达式上不能加上引号,而且以点代表任意字符,最后面是不能加上(... fishyoung Linux/Windows 2019-6-20 6200 0
正则表达式linuxshell判断全数字 Linux | shell判断输入是否为全数字 在编写交互式脚本的时候经常需要检查输入,比如检查输入是否为整数。思路一:正则表达式read -p "Please input an integer: " num[[ "$num" ... fishyoung Linux/Windows 2019-6-18 4964 0
linuxshellEOF解决方案 Linux | shell中的wanted 'EOF'错误解决 在Linux中编写shell后,执行报错如下:warning: here-document at line 5 delimited by end-of-file (wanted `EOF`shell 脚本执行‘warning’:执行... fishyoung Linux/Windows 2019-6-14 8306 0
linuxshellDockergreat Linux | shell脚本value too great for base 今天在编写shell脚本的时候发现了这个问题:08: value too great for base (error token is "08") 原因是:tar_file_month=`date +%... fishyoung Linux/Windows 2019-5-24 4289 0
linuxshell参数 Linux 7 | shell参数传递 在执行shell脚本时可以传递参数:脚本获取参数的格式为:$0 $1 $2 ...其中$1 ... fishyoung Linux/Windows 2018-8-1 3560 0
linuxshellbashrcprofile Linux环境变量初始化与对应文件的生效顺序 在登录Linux系统并启动一个bash shell时,默认情况下bash会在若干个文件中查找环境变量的设置,这些文件可统称为系统环境变量。bash检查的环境变量文件的情况取决于系统运行shell的方式,方式一般有以下三... fishyoung Linux/Windows 2017-9-30 6583 0