Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
到目前为止,我有这个:
Executables=$(cd $tarchive | awk ‘{print $1 }’ | grep –c ‘d’)
理论上,这会搜索.sh文件并对其进行计数。我想做同样的事情,但对于可执行文件。
.sh
尝试
Executables=`tar -tvf archive.tar | grep "^...x" | awk '{print $6}'`
说明:
command
$(command)
tar -tvf archive.tar
archive.tar
grep "^...x"
.
x
awk '{print $6}'