Skip to content
Advertisement

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

Advertisement

Answer

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
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement