我想对特定文件夹中不以特定前缀(例如exclude_)开头的所有文件进行操作。我有一个for带有扩展 glob的 bash循环,如下所示:
for FILE in foo/bar/!(exclude_*) ; do echo $FILE ; done
Run Code Online (Sandbox Code Playgroud)
在命令行上,这工作正常:
$ for FILE in foo/bar/!(exclude_*) ; do echo $FILE ; done
foo/bar/apple
foo/bar/pear
foo/bar/banana
Run Code Online (Sandbox Code Playgroud)
但是,当我在 makefile 中使用它时:
target:
for FILE in foo/bar/!(exclude_*) ; do echo $$FILE ; done
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
$ make
for FILE in foo/bar/!(exclude_*) ; do echo $FILE ; done
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `for FILE in foo/bar/!(exclude_*) ; do echo …Run Code Online (Sandbox Code Playgroud) 出于某种奇怪的原因,make在 Windows 上编译时一直给我制表错误,所以我在 Ubuntu 上试了一下,效果很好。
现在我想使用我在 Ubuntu 上编译得到的可执行文件并在 Windows 上使用它。但是,当我在 Windows 上下载它时,我得到的文件类型是不同的,因为它只是类型file. 鉴于它是在 Ubuntu 上编译的,是否可以在 Windows 上运行它?
这可能是一个愚蠢的问题,但请耐心等待。
我正在自动化一些我在设置新工作环境时所做的常见事情,并希望自动化 Vim 命令:BundleInstall(用于安装我所有的 Vim 插件)。
是否可以从 shell 运行它?
或者,是否可以让脚本运行 Vim,执行:BundleInstall,等到它完成并退出?
谢谢。
我以普通用户身份登录。我应该使用:
./configure && make && make install
Run Code Online (Sandbox Code Playgroud)
或者
sudo ./configure && sudo make && sudo make install
Run Code Online (Sandbox Code Playgroud)
或者
./configure && make && sudo make install
Run Code Online (Sandbox Code Playgroud)
安装软件包时。
有人可以解释这些差异吗?
我希望所有用户都能使用它。
我有一个使用 make 文件进行编译的 LaTeX 项目,并且想使用 Kile 在 Windows 上编写文本。
我在 google 上快速浏览了一下,但只是真正想出了Make for Windows,它的最后一个版本可以追溯到 2006 年。也许它做得非常好且稳定,但我仍然想知道:
在 Windows 上使用 makefile 的替代方法有哪些(如果有的话)?
在理想情况下,我想将该工具配置到 Kile(它在 Windows 上运行,是的)并从那里运行它。
我正在安装MOOG,当make -f Makefile.maclap我收到错误时:
$ make -f Makefile.maclap
g77 -w -c -o Abfind.o Abfind.f
make: g77: No such file or directory
make: *** [Abfind.o] Error 1
Run Code Online (Sandbox Code Playgroud)
经过网上研究,我认为,由于我有 gcc-5,因此我的计算机上不存在命令 g77。
因此,我根据堆栈交换问题alias g77=/usr/local/bin/gfortran-5尝试使用 gfortran 编译 fortran 代码。
现在,当我g77看到gfortran-5: fatal error: no input files compilation terminated,表明它g77正在作为编译的工作。
但是当我make -f Makefile.maclap仍然收到错误时:
$ make -f Makefile.maclap
g77 -w -c -o Abfind.o Abfind.f
make: g77: No such file or directory
make: *** [Abfind.o] Error …Run Code Online (Sandbox Code Playgroud) 当我编写 LaTeX 文档时,我发现自己经常在编辑器中按 F6 进行编译。或者当我使用 SASS 时,我经常输入make将 my 转换.scss为.css.
现在我想让机器在make每次给定文件更改时做脏活并运行或其他东西。
到目前为止,我一直打开一个终端窗口,然后按向上箭头并返回。或者我使用了watch make,但这似乎是一个奇怪的解决方案。
当给定的文件更改时,Linux 上是否有一种很好的方法来做某事?
make 然后失败了:
配置:错误:没有找到 termcap 库,但是 termcap 库就在那里,为什么找不到它?
checking for library containing zlibVersion... -lz
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for library containing dlgetmodinfo... no
checking for iconv... yes
checking for iconv declaration... install-shextern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
configure: error: no termcap …Run Code Online (Sandbox Code Playgroud) test:
@echo "#!/bin/bash\njava -classpath \"$(CLASSPATH)\" com.atm.ATM \"$@\"" > test
@chmod a+x test
Run Code Online (Sandbox Code Playgroud)
我试图转义“$@”,以便它在“测试”脚本中以“$@”字面出现(将在 bash 脚本上调用的参数传递给 java 程序)。
我尝试过的事情:
"$$@" -> ""
"$$@@" -> "@"
"$@@" -> "<target>@"
Run Code Online (Sandbox Code Playgroud)
我该怎么做呢?
所以我在雪豹上安装了 XCode。为什么我会收到这样的消息:
sudo: make: command not found
Run Code Online (Sandbox Code Playgroud)
我需要做什么来解决这个问题?
我不确定发生了什么,但我能够通过下载最新版本的 XCode并重新安装来解决问题。现在我可以看到我已经正确安装了 make 。
$ which make
/usr/bin/make
Run Code Online (Sandbox Code Playgroud)