Skip to content

[Feature Request]: check/ck_cmd: check if given list of commands exist #86

@aronchanisme

Description

@aronchanisme

Is there an existing issue for the feature request?

  • I have checked the existing issues.

Feature Description

check/ck_cmd: check if given command exists

usage: 
check/ck_cmd.sh <command_list>, where,
command_list: e.g. mysql,go,gcc

example:
check/ck_cmd.sh "mysql,go,gcc"
check/ck_cmd.sh "ls"

output:
return 0: if all commands exist
return 1: if at least one command not exists, or invalid usage

Feature Implementation

cmd="ls"
if command -v ${cmd}; then
    flag=0
else
    flag=1
fi

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions