( ! ) 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.0008415656{main}( ).../index.php:0
20.08774721280Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.344314257488Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.344514257432Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.344614257808Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.344614257808Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.344714257904Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.345014297824require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.351214595512GKTemplate->__construct( ).../component.php:31
100.357214764888GKTemplateMenu->getMenuType( ).../gk.framework.php:84
110.358114809744require_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.0008415656{main}( ).../index.php:0
20.08774721280Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.344314257488Joomla\CMS\Application\SiteApplication->render( ).../CMSApplication.php:202
40.344514257432Joomla\CMS\Application\SiteApplication->render( ).../SiteApplication.php:778
50.344614257808Joomla\CMS\Document\HtmlDocument->parse( ).../CMSApplication.php:1030
60.344614257808Joomla\CMS\Document\HtmlDocument->_fetchTemplate( ).../HtmlDocument.php:545
70.344714257904Joomla\CMS\Document\HtmlDocument->_loadTemplate( ).../HtmlDocument.php:730
80.345014297824require( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/component.php' ).../HtmlDocument.php:668
90.351214595512GKTemplate->__construct( ).../component.php:31
100.360814937688GKTemplateMenu->getMenuType( ).../gk.framework.php:85
怎么把命令输出结果赋值给变量(已解决)
Logo
Print this page

怎么把命令输出结果赋值给变量(已解决)

我要把
awk '/eth0/{print $1 }' /proc/net/dev |sed 's/eth0://'
输出的结果赋值给变量 input

搞定了
input=$(awk '/eth0/{print $1 }' /proc/net/dev |sed 's/eth0://'
)

 

 

 

awk '/eth0/{print $1 }' /proc/net/dev |sed 's/eth0://'
不能用一个句子写出来?
awk -F "[: ]+" '/eth0/{print $3}' /proc/net/dev

 

 

http://cu.img168.net/static/image/common//icon_quote_e.gif); line-height: 1.6; zoom: 1; background-position: 100% 100%; background-repeat: no-repeat no-repeat;">假如一个命令ls有3个输出1,2,3;
我如何把1,2,3分别赋值给VAR1,VAR2,VAR3呢?
  1. #bash
  2. /home/lee#ls [0-9]
  3. 1  2  3
  4. /home/lee#while read file;do ((++n));eval var$n=$file;done< <(ls [0-9])
  5. /home/lee#echo $var1
  6. 1
  7. /home/lee#echo $var2
  8. 2
  9. /home/lee#echo $var3

 

 

 


( ! ) 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.0009414624{main}( ).../index.php:0
20.20604265616Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.20604265616Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.701611456968Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.702811481664Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.703911536992Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.704311564392require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.715611964024K2ControllerItem->execute( ).../k2.php:64
90.715611964024K2ControllerItem->display( ).../BaseController.php:710
100.750012614728K2ControllerItem->display( ).../item.php:78
110.750012614728K2ControllerItem->display( ).../controller.php:19
120.765812985768Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.768813006136K2ViewItem->display( ).../ViewController.php:102
140.914615848272K2ViewItem->display( ).../view.html.php:742
150.914615848272K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.952216021208include( '/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.0009414624{main}( ).../index.php:0
20.20604265616Joomla\CMS\Application\SiteApplication->execute( ).../index.php:49
30.20604265616Joomla\CMS\Application\SiteApplication->doExecute( ).../CMSApplication.php:196
40.701611456968Joomla\CMS\Application\SiteApplication->dispatch( ).../SiteApplication.php:233
50.702811481664Joomla\CMS\Component\ComponentHelper::renderComponent( ).../SiteApplication.php:194
60.703911536992Joomla\CMS\Component\ComponentHelper::executeComponent( ).../ComponentHelper.php:377
70.704311564392require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ).../ComponentHelper.php:402
80.715611964024K2ControllerItem->execute( ).../k2.php:64
90.715611964024K2ControllerItem->display( ).../BaseController.php:710
100.750012614728K2ControllerItem->display( ).../item.php:78
110.750012614728K2ControllerItem->display( ).../controller.php:19
120.765812985768Joomla\CMS\Cache\Controller\ViewController->get( ).../BaseController.php:663
130.768813006136K2ViewItem->display( ).../ViewController.php:102
140.914615848272K2ViewItem->display( ).../view.html.php:742
150.914615848272K2ViewItem->loadTemplate( ).../HtmlView.php:230
160.952216021208include( '/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.