花椒
- 花椒 2019-05-01 已签到连续签到218天,获得了20个金钱
-d 以后台模式启动,-r定义使用的目录
mkdir $(date '+%Y%m%d')
比如现在执行,就在当前目录创建了一个名叫20190430的文件夹~
#!/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 mkdir "$myPath" fi #这里的-f参数判断$myFile是否存在 if [ ! -f "$myFile" ]; then touch "$myFile" fi #其他参数还有-n,-n是判断一个变量是否是否有值 if [ ! -n "$myVar" ]; then echo "$myVar is empty" exit 0 fi #两个变量判断是否相等 if [ "$var1" = "$var2" ]; then echo '$var1 eq $var2' else echo '$var1 not eq $var2' fi
- 花椒 回答了问题 请问一下 Linux 定时任务如何创建文件夹?
mkdir $(date '+%Y%m%d')
比如现在执行,就在当前目录创建了一个名叫20190430的文件夹~
- 花椒 回答了问题 小白问题,为什么对象都可以 echo ?
ActiveField有__toString()方法~
/*** PHP magic method that returns the string representation of this object. * @return string the string representation of this object. */ public function __toString() { // __toString cannot throw exception // use trigger_error to bypass this limitation try { return $this->render(); } catch (\Exception $e) { ErrorHandler::convertExceptionToError($e); return ''; } } public function render($content = null) { if ($content === null) { if (!isset($this->parts['{input}'])) { $this->textInput(); } if (!isset($this->parts['{label}'])) { $this->label(); } if (!isset($this->parts['{error}'])) { $this->error(); } if (!isset($this->parts['{hint}'])) { $this->hint(null); } $content = strtr($this->template, $this->parts); } elseif (!is_string($content)) { $content = call_user_func($content, $this); } return $this->begin() . "\n" . $content . "\n" . $this->end(); }
- 花椒 2019-04-30 已签到连续签到217天,获得了20个金钱
- 花椒 2019-04-29 已签到连续签到216天,获得了20个金钱
- 花椒 回答了问题 阿里云免费 SSL 支持多少个二级域名?
总共1个域名,不管是一级还是二级,就1个~
- 花椒 回复了话题 这半个月学了 Java 发现和 PHP 非常的相似
那我推荐你jfinal框架吧,极速~
https://www.jfinal.com/