我正在编写一个 shell 函数,它将从许多不同的地方调用,我想忽略函数内部发生的所有错误,禁用(可能启用)set -eshell 选项,执行set +e.
问题是我不知道是否设置了该选项,所以我不知道是否真的需要禁用它,更重要的是,如果我需要在最后再次设置它。
那么,我怎么知道它是否已设置?有没有办法忽略 shell 函数中所有命令的错误,-e如果设置了则忽略shell 选项?
Linux 中的服务如何使用权限?我已经知道我可以设置read,write以及execute对文件和目录的权限chmod分别用于owner,group以及other users但是如何权限运行的服务工作?如何查看服务对特定文件/目录的权限?
我正在尝试安装一个需要 GNU 科学库 (GSL) 的统计程序。我已经通过yum命令成功安装了 GSL ,但是当我尝试运行make install. 我认为存在链接问题。我该如何解决?
$ sudo yum install gsl.x86_64
Installed:
gsl.x86_64 0:1.15-3.fc16
Dependency Installed:
atlas.x86_64 0:3.8.4-1.fc16
$ tar -xvzf prog.tgz
$ cd prog
$ make
$ gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o prog.o prog.c
In file included from prog.c:16:0:
prog.h:7:30: fatal error: gsl/gsl_sf_gamma.h: No such file or directory
compilation terminated.
make: *** [prog.o] Error 1
Run Code Online (Sandbox Code Playgroud)