//JavaScript根据文件名后缀判断是否图片文件 //图片文件的后缀名 var imgExt = new Array(".png",".jpg",".jpeg",".bmp",".gif"); //获取文件名后缀名 String.prototype.extension = function(){ var ext = null; var name = this.toLowerCase(); var i
2.23/2.24/2.25 find命令 2.26 文件名后缀 find 搜索文件的命令: which 它是从环境变量中找: [root@centos_1 ~]# which ls alias ls='ls --color=auto' /usr/bin/ls 环境变量: [root@centos_1 ~]# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/tmp/:/root/bin whereis ls 查看文
核心代码 #!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/access.log" #这里的-x 参数判断$myPath是否存在并且是否具有可执行权限 if [ ! -x "$myPath"]; then mkdir "$myPath" fi #这里的-d 参数判断$myPath是否存在 if [ ! -d "$myPath"]; then
1. shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function's return value. $$ The program's PID. $!