从外壳设置`ulimit -c`(set `ulimit -c` from outside shell)
我有一个程序在启动时自动运行,并且偶尔会导致coredump。
我想记录输出,但我似乎无法以编程方式设置
ulimit -c
(默认为0,并且每次都重置)。我尝试过使用bash脚本,以及python的
sh
,os.system
和os.system
,但是我无法使它工作。I have a program that's running automatically on boot, and sporadically causing a coredump.
I'd like to record the output, but I can't seem to set
ulimit -c
programmatically (It's defaulted to 0, and resets every time).I've tried using a bash script, as well as python's
sh
,os.system
andsubprocess
, but I can't get it to work.
原文:https://stackoverflow.com/questions/25475906
满意答案
根据您的结构,您有一个包含对象的数组。 似乎
getavgTimeOnSite()
是一个访问数据的实用工具方法? 所以你的array
和object
数据并没有真正帮助调试。 好吧,除了让我知道有一个带有object
的array
! 所以也许您可以像这样访问数据:echo '<div><span>Avg TimeOnSite</span><br />' . $resultsTotal[0]->getavgTimeOnSite() . '</div>';
甚至用
foreach
滚动数组:foreach ($resultsTotal as $result) { echo '<div><span>Avg TimeOnSite</span><br />' . $result->getavgTimeOnSite() . '</div>'; }
我还找到了一个项目的源代码,该项目显示了开发人员如何访问Google Analytics请求中的数据。 查看它以获得有关如何访问数据的更多见解。
Based on your structure you have an array with objects. Also it seems like
getavgTimeOnSite()
is a utility method that accesses the data? So yourarray
andobject
data doesn’t really help debug much. Well, other than letting me know there is anarray
with anobject
in it! So perhaps you can access the data like this:echo '<div><span>Avg TimeOnSite</span><br />' . $resultsTotal[0]->getavgTimeOnSite() . '</div>';
Or even roll through the array with a
foreach
:foreach ($resultsTotal as $result) { echo '<div><span>Avg TimeOnSite</span><br />' . $result->getavgTimeOnSite() . '</div>'; }
I also found this source code for a project that shows how the developer is accessing data in Google Analytics requests. Check it out to get more insights into how to access data.
相关问答
更多&符号前置于数组var_dump的末尾(Ampersand prepended at end of array var_dump)
var_dump()和print_r()输出不同的值(var_dump() and print_r() output different values)
php导出var_dump值(php export var_dump values)
当var_dump存在时,中止git pre-commit钩子(aborting git pre-commit hook when var_dump present)
var_dump存在值但不能调用它们(var_dump present values but cant call them)
dd()读取var_dump()无法读取的值(dd() reads values that var_dump() can't read)
Codeigniter echo / var_dump无法正常工作(Codeigniter echo/var_dump not working)
PHP中的方法是否有相当于var_dump的方法?(Is there an equivalent of var_dump for methods in PHP?)
PHP拒绝从var_dump,print等输出数据(PHP refuses to output data from var_dump, print, etc)
结果的var_dump给出null值。(var_dump of result gives null value. But deeper inspection returns a integer [duplicate])
相关文章
更多Shell的分类
linux shell awk 语法
shell脚本常规技巧
Linux命令、编辑器、Shell编程实例大全
Linux Shell Scripting Cookbook(Linux Shell脚本攻略_英文版.pdf)
Python内建函数(C)
《C/C++图像处理编程》扫描版[PDF]
使用Shell客户端操作kafka
C语言面试题(带答案)三
bash shell循环的疑问
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!