sed: can't read Makefile: No such file or directory
6,399
The Makefile is not created until you've run the configure
script. Try placing the sed
command after the invocation of configure
.
I haven't checked if the sed
edit is doing what it should or not, but the main issue is probably that the Makefile simply doesn't exist yet at that point in your script.
In general, I would avoid sed -i
as its semantics is different for GNU and BSD sed
. It's safer to sed ... file >tmpfile && mv tmpfile file
.
Related videos on Youtube
Author by
user977828
Updated on September 18, 2022Comments
-
user977828 over 1 year
I tried to replace a line in a
Makefile
withsed -i -e 's|$(bindir)\/embossupdate|:|' Makefile
, but I gotsed: can't read Makefile: No such file or directory
FROM ubuntu:16.04 ... # EMBOSS (ftp://emboss.open-bio.org/pub/EMBOSS/) ENV EMBOSS_VER 6.6.0 RUN apt-get install libhpdf-dev libpng12-dev libgd-dev -y ADD EMBOSS-${EMBOSS_VER}.tar.gz /usr/local/ WORKDIR /usr/local/EMBOSS-${EMBOSS_VER} RUN sed -i -e 's|$(bindir)\/embossupdate|:|' Makefile RUN ./configure --enable-64 --with-thread --without-x RUN make RUN ldconfig RUN make install
What did I do wrong with the sed command?
-
cuonglm over 7 yearsIt's not about
sed
, but sounds like you don't haveMakefile
inEMBOSS-${EMBOSS_VER}
. -
Andreas Wiese over 7 yearsI think cuonglm is right. Further, your
sed
-expression won't do what you except, as you forgot to escape$
, which will match the end-of-line in this expression. -
Kusalananda over 7 years@AndreasWiese The
$
is an ordinary character unless at the end of the expression (or at the end of a group) in a BRE.
-