简体   繁体   中英

Bash - Linux from scratch, cheching library script

I reading LSF and saw some operation, description one i am not found.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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