#!/bin/bash

if [ -f '/usr/bin/gperf' ]; then echo 'gperf exists' else echo 'gperf does not exist' fi

说明:

-f 参数用于判断一个文件是否存在

'/usr/bin/gperf' 是 gperf 的安装路径,根据实际情况可能会有所不同

Bash 脚本检查 gperf 文件是否存在