これはどういう意味ですか? if[! -e "$exe"];

これはどういう意味ですか? if[! -e

私はLinuxでスクリプトを見ました。これが何を意味するのか知りたいです。

if [ ! -e "$exe" ]; then
  exe='/path to some file'
fi

ベストアンサー1

info test詳細を表示するには実行してください。

16.3.3 File characteristic tests
--------------------------------

These options test other file characteristics.

‘-e FILE’
     True if FILE exists.

‘-s FILE’
     True if FILE exists and has a size greater than zero.

‘FILE1 -nt FILE2’
     True if FILE1 is newer (according to modification date) than FILE2,
     or if FILE1 exists and FILE2 does not.

‘FILE1 -ot FILE2’
     True if FILE1 is older (according to modification date) than FILE2,
     or if FILE2 exists and FILE1 does not.

‘FILE1 -ef FILE2’
     True if FILE1 and FILE2 have the same device and inode numbers,
     i.e., if they are hard links to each other.

おすすめ記事