( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKBase.class.php on line 114
Call Stack
#TimeMemoryFunctionLocation
10.0010416120{main}( ).../index.php:0
20.11654721616Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.437214258032Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.437514257976Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.437514258352Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.437514258352Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.437714258448Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.438314298368require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.444614596056GKTemplate->__construct( ).../component.php:31
100.452414765432GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.453414810288require_once( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKMenu.php' ).../helper.menu.php:19

( ! ) Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/lib/menu/GKHandheld.php on line 76
Call Stack
#TimeMemoryFunctionLocation
10.0010416120{main}( ).../index.php:0
20.11654721616Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.437214258032Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.437514257976Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.437514258352Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.437514258352Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.437714258448Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.438314298368require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.444614596056GKTemplate->__construct( ).../component.php:31
100.455914938232GKTemplateMenu->getMenuType( ).../gk.framework.php:85
grep 正则表达式选项要记得转义
Logo
Print this page

grep 正则表达式选项要记得转义

使用过程中,使用最多的参数就是 -v ,但是用着并不爽。

比如说,我想查找一个单词“UserService”,但是像”*.svn” 这种文件就不用显示了,我该怎么做呢?

grep -r "UserService" ./ | grep -v "svn"

但是,如果类似于含有”test、auto_load”之类的文件我也不显示,怎么做呢?我之前的做法是:

grep -r "UserService" ./ | grep -v "svn" | grep -v "test" | grep -v "auto_load"

命令很长,而且麻烦,于是就想,grep本身是按照正则表达式来当做选项的,那么我是不是可以利用到正则表达式的“或|”命令?

grep -r "UserService" ./ | grep -v "svn|test|auto_load"

很显示,执行结果显示上面的命令不符合我的需求,于是苦思不得其解。原来,在使用正则表达式选项时,要记得将”|”转义。最终命令如下:

grep -r "UserService" ./ | grep -v "svn\|prj\|test\|auto_load"

( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
Call Stack
#TimeMemoryFunctionLocation
10.0003416064{main}( ).../index.php:0
20.07464721560Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.07464721560Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.309112449952Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.309712474632Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.310512529960Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.310912558784require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.321812994192K2ControllerItem->execute( ).../k2.php:64
90.321812994192K2ControllerItem->display( ).../BaseController.php:710
100.334213719392K2ControllerItem->display( ).../item.php:78
110.334213719392K2ControllerItem->display( ).../controller.php:19
120.338514115760Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.339914136128K2ViewItem->display( ).../ViewController.php:102
140.410317117896K2ViewItem->display( ).../view.html.php:742
150.410317117896K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.412017298096include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701

( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
Call Stack
#TimeMemoryFunctionLocation
10.0003416064{main}( ).../index.php:0
20.07464721560Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.07464721560Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.309112449952Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.309712474632Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.310512529960Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.310912558784require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.321812994192K2ControllerItem->execute( ).../k2.php:64
90.321812994192K2ControllerItem->display( ).../BaseController.php:710
100.334213719392K2ControllerItem->display( ).../item.php:78
110.334213719392K2ControllerItem->display( ).../controller.php:19
120.338514115760Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.339914136128K2ViewItem->display( ).../ViewController.php:102
140.410317117896K2ViewItem->display( ).../view.html.php:742
150.410317117896K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.412017298096include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ).../HtmlView.php:701
Template Design © Joomla Templates | GavickPro. All rights reserved.