当我使用GNU Make编译代码时,我会收到多个警告:
clang: warning: -lGui: 'linker' input unused
Run Code Online (Sandbox Code Playgroud)
这可能是因为我在Makefile(下面)中弄乱了一些东西.任何人都能指出我的问题吗?
CXX=g++
CC=g++
CXXFLAGS=-g -Wall -W -Wshadow -Wcast-qual -Wwrite-strings $(shell root-config --cflags --glibs)
CPPFLAGS+=-MMD -MP
LDFLAGS=-g $(shell root-config --ldflags)
LDLIBS=$(shell root-config --libs)
xSec_x: xSec_x.o xSec.o Analysis.o
-include xSec_x.d xSec.d Analysis.d
xSec.o: xSec.cpp xSec.h Analysis.h Analysis.cpp
xSec_x.o: xSec_x.cpp xSec.h Analysis.h
clean:
rm -f @rm -f $(PROGRAMS) *.o *.d
Run Code Online (Sandbox Code Playgroud) 我有一个失败的脚本,因为缺少一些文件.
运行脚本并将其管道连接到grep
$ ./adder | grep Error
Run Code Online (Sandbox Code Playgroud)
产生以下输出:
Error in <TFile::ReadBuffer>: error reading all requested bytes from file v2.2_V3_194424_194712/output_853.root, got 0 of 300
Error in <TFile::Init>: v2.2_V3_194424_194712/output_853.root not a ROOT file
Run Code Online (Sandbox Code Playgroud)
和不同文件的类似输出
我想v2.2_V3_194424_194712/output_853.root
从这个输出中提取根文件,但是做./adder | grep Error | grep .root
不起作用.
这是为什么?
我需要一个shell脚本来查找和替换类似的文本:
For each line in a file
find equation mark "="
remove everything up to the equation mark on that line and replace it with the string cuts[Counter] where Counter counts how many times such substitutions have been made.
Run Code Online (Sandbox Code Playgroud)
开始使用这样的脚本可以帮助我吗?