简体   繁体   English

Bash-Linux从零开始,检查库脚本

[英]Bash - Linux from scratch, cheching library script

I reading LSF and saw some operation, description one i am not found. 我阅读LSF并看到一些操作,但找不到描述之一。

Please tell me what this means: 请告诉我这是什么意思:

lib{gmp,mpfr,mpc}.la

Full code listing: 完整代码清单:

cat > library-check.sh << "EOF"
#!/bin/bash
for lib in lib{gmp,mpfr,mpc}.la; do
  echo $lib: $(if find /usr/lib* -name $lib|
               grep -q $lib;then :;else echo not;fi) found
done
unset lib
EOF

bash library-check.sh

Source: LFS - Host System Requirements 来源: LFS-主机系统要求

This is a globbing wildcard pattern. 这是通配符模式。 It causes the shell to expand the line to 它使外壳将线扩展到

for lib in libgmp.la libmpfr.la libmpc.la; do
    # ...
done

More on shell expansion and wildcard patterns: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_04.html 有关Shell扩展和通配符模式的更多信息: http : //tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_04.html

Taking the first example from there, you can try the effect on the command line yourself: 从那里拿第一个示例,您可以自己在命令行上尝试效果:

$ echo sp{el,il,al}l
spell spill spall

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM