它的用途是EXTRA_CFLAGS什么?
我在某些情况下看到它,但我永远不明白为什么人们不会只是附加旗帜CFLAGS而不是EXTRA_CFLAGS.
我首先想到的是make如何定义其隐式规则,但事实并非如此.据我所知,EXTRA_CFLAGS在make隐式规则中没有使用,对吗?
我很感激任何启蒙.
如果一行返回非零结果,我过去使用的每个系统都会继续我的简单bash脚本.一些新的Ubuntu LTS 14.x系统现在在第一次失败时退出.我用了
echo $-
Run Code Online (Sandbox Code Playgroud)
并且e不会出现在列表中.我还应该寻找什么?
添加评论:
$ declare -f command_not_found_handle
command_not_found_handle ()
{
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1";
return $?;
else
if [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1";
return $?;
else
printf "%s: command not found\n" "$1" 1>&2;
return 127;
fi;
fi
}
Run Code Online (Sandbox Code Playgroud) 如果我在命令shell上以交互方式运行它,我的脚本会起作用:
$ cat ndmpcopy_cron_parallel_svlinf05.bash
#!/usr/software/bin/bash
ndmpcopy_cron_parallel() {
timestamp=`date +%Y%m%d-%H%M`
LOG=/x/eng/itarchives/ndmpcopylogs/05_$1/ndmpcopy_status
TSLOG=${LOG}_$timestamp
src_filer='svlinf05'
src_account='ndmp'
src_passwd='src_passwd'
dst_svm='svlinfsrc'
dst_account='vsadmin-backup'
dst_passwd='dst_passwd'
host=`hostname`
echo $host
ssh -l root $src_filer "priv set -q diag ; ndmpcopy -sa $src_account:$src_passwd -da $dst_account:$dst_passwd -i $src_filer.eng.netapp.com:/vol/$1 10.56.10.161:/$dst_svm/$1" | tee -a $TSLOG
echo "ndmpcopy Completed: `date` "
}
export -f ndmpcopy_cron_parallel
/u/jsung/bin/parallel -j 0 --wd . --env ndmpcopy_cron_parallel --eta ndmpcopy_cron_parallel ::: local
Run Code Online (Sandbox Code Playgroud)
但是,脚本失败并抱怨导出的函数ndmpcopy_cron_parallel无法找到:
$ crontab -l
40 0,2,4,6,8,10,12,14,16,18,20,22 * * * /u/jsung/bin/ndmpcopy_cron_parallel_svlinf05.bash
Run Code Online (Sandbox Code Playgroud)
Subject: Cron <jsung@cycrh6svl18> /u/jsung/bin/ndmpcopy_cron_parallel_svlinf05.bash
Computers / CPU cores …Run Code Online (Sandbox Code Playgroud) 我想从stash中检出一个文件:
git checkout stash@{0} -- some/file
Run Code Online (Sandbox Code Playgroud)
这失败了 fatal: invalid reference: stash@0
看起来花括号被淘汰了,但我不确定罪魁祸首.
存储修订就在那里.git stash list回报
stash@{0}: WIP on X
stash@{1}: WIP on Y
Run Code Online (Sandbox Code Playgroud)
我在zsh上使用git 1.9.1.
有没有办法防止这种大括号消除?
我正在获取EC2实例的列表,然后尝试遍历它们,但是由于某种原因,我无法使该循环正常工作。
output="$(aws ec2 describe-instances --filters 'Name=tag:Environment,Values=development' --query '[Reservations[*].Instances[*].PublicDnsName]' --output text)"
echo $output 显示如下:
ec2-55-55-555-555.eu-west-1.compute.amazonaws.com
ec2-66-66-666-666.eu-west-1.compute.amazonaws.com
Run Code Online (Sandbox Code Playgroud)
然后我创建一个像这样的数组:
instances=(${output//'\n'/ })
Run Code Online (Sandbox Code Playgroud)
echo ${instances[0]}并echo ${instances[1]}给出正确的输出。
然后尝试遍历数组:
for i in $instances; do echo instance: "$i"; done
但是我得到:
实例:ec2-55-55-555-555.eu-west-1.compute.amazonaws.com ec2-66-66-66-666-666.eu-west-1.compute.amazonaws.com
代替:
instance: ec2-55-55-555-555.eu-west-1.compute.amazonaws.com
instance: ec2-66-66-666-666.eu-west-1.compute.amazonaws.com
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?是否有更好的方法遍历结果,也许使用json输出格式?
我正在学习如何编写 Makefile。我找到了 .VARIABLES 变量,它保存了 Makefile 中所有有效的变量。
我可以用这样的命令检查变量的名称:
test:
@echo "${.VARIABLES}" | tr ' ' '\n'
Run Code Online (Sandbox Code Playgroud)
但我不知道他们的价值观应该如何。谁能教我这样做?
我正在为依赖于php-mcrypt. 我的目标操作系统CentOS 6.5 php-mcrypt不在CentOS存储库中,但在EPEL. 有没有Requires:比手动安装EPEL更好的方法来满足这种在线依赖关系%pre?我真的不喜欢在 中强制安装另一个存储库的想法RPM,但我也不喜欢当RPMs 无法安装似乎不存在的依赖项时,直到有人足够聪明开始搜索各种国外回购。
处理这个问题的最佳方法是什么?
我正在创建一个模板来预安装特定的软件包。模板可以启动实例和安全组,但没有安装任何东西。跑步时
/opt/aws/bin/cfn-init -s SIM --access-key=XXX --secret-key=XXX --region us-west-2 -r WebServer
Run Code Online (Sandbox Code Playgroud)
我得到:构建期间发生错误:Yum 没有可用于安装的 gcc
"Resources": {
"WebServer": {
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"packages" : {
"yum" : {
"gcc " : [],
"make" : [],
"gcc-c++" : [],
"nginx" : [],
"zlib" : [],
"zlib-devel" : [],
"rubygems" : [],
"git-core" : [],
"selinux-policy-targeted" : [],
"selinux-policy-devel" : [],
"libmemcached" : [],
"libmemcached-devel" : []
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我已经列出了一个目录:
-parent
-target
-current
-firstChild
-secondChild
Run Code Online (Sandbox Code Playgroud)
我试图将我的 package.path 从“secondChild”内部定向到“target”以检索隐藏在那里的其他 .lua 文件夹。我目前有这个设置
package.path = package.path .. ';../?.lua;../?.lua;../?.lua;target/?.lua'
Run Code Online (Sandbox Code Playgroud)
这没有找到我正在寻找的东西,我确信我的部分问题是我不理解所有的语法。“;../?.lua”对我来说,我要返回到“firstChild”并检查是否有 lua 文件?
我在这里缺少什么?
我正在尝试将 Linux 内核的 kconfig util 移植到我的产品
编译时出现下一个错误:
make[6]: *** No rule to make target `zconf.tab.c', needed by `zconf.tab.o'. Stop.
Run Code Online (Sandbox Code Playgroud)
我在 Makefile.lib 中找到了该文件的下一条规则
$(obj)/%: $(src)/%_shipped
$(call cmd,shipped)
Run Code Online (Sandbox Code Playgroud)
它对我来说看起来不错,它只适用于内核,但不适用于我的产品。
然后我在前一条规则之后添加了另一条规则。
$(obj)/%c: $(src)/%c_shipped
$(call cmd,shipped)
Run Code Online (Sandbox Code Playgroud)
现在效果很好。
有人可以解释一下原来的规则有什么问题吗?
就我而言obj=.,和src=.(两者=点)。当前目录包含适当的*_shipped文件。