#!/bin/sh
for file in ./*.a
do
if test -f $file
then
echo $file
echo 是文件
nm -a $file| grep $1
fi
if test -d $file
then
echo $file
echo 是目录
fi
done
本文提供了一个Shell脚本示例,该脚本遍历当前目录下所有.a文件,并使用nm命令列出符号表中包含特定字符串的条目。此外,脚本还会检查文件是否为目录并进行相应标记。
#!/bin/sh
for file in ./*.a
do
if test -f $file
then
echo $file
echo 是文件
nm -a $file| grep $1
fi
if test -d $file
then
echo $file
echo 是目录
fi
done

被折叠的 条评论
为什么被折叠?