Shell中too many arguments错误的解决方法

Shell中too many arguments错误的解决方法

Shell
原因: 中括号兼容问题 错误常出现在if语句中,可以直接将"[ ]"替换成"[[ ]]"就可以了 示例: if [ $version == 7 ];then 修改为 if [[ $version...
Shell格式化输出时间

Shell格式化输出时间

Shell
1.命令 +%Y:年+%m:月+%d:日+%H:时+%M:分+%S:秒 2.示例: [Mac@18:41:29]~$ date +%y21[Mac@18:54:54]~$ date +%y%m2106[Mac@18:55:08]~$ d...
Centos根据系统版执行相应命令

Centos根据系统版执行相应命令

Shell
本脚本适用Centos 6 和Centos 7 1.脚本 #!/bin/bashversion=`cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'` if [ $version == 6 ];t...
shc加密shell脚本

shc加密shell脚本

Shell
  shc是一个加密shell脚本的工具.它的作用是把shell脚本转换为一个可执行的二进制文件. yum安装: yum -y install shc 编译安装: wget...