intel / intel/lkvs

Why use "which" to check existed file?

Open
#358 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
36
Forks
38
Avg merge
1d 12h
Merged PRs (30d)
14

Description

./runtests -f sdsi/tests
==> /tmp/stderr <==
|0816_074419.075|ERROR| common.sh:155:block_test() - block_test() is called by common.sh:571:check_fms_list()|
|0816_074419.077|ERROR| common.sh:156:block_test() - Result ====BLOCK==== : No family model stepping list file:sdsi_fms_list found|

The function of check_fms_list is in common.sh for checking existed files.
$fms_list_file is the existed file.
"
list_file=$(which "$fms_list_file" 2>/dev/null)
[[ -n "$list_file" ]] || block_test "No family model stepping list file:$fms_list_file found"
"
Why use "which" to check the existed file of "$fms_list_file"?
It should get the not right results.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.