Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
bash错误handlng-文件是否存在?_Bash - Fatal编程技术网

bash错误handlng-文件是否存在?

bash错误handlng-文件是否存在?,bash,Bash,我有一个脚本来解密一个加密的文件,但我只想在文件存在的情况下解密 bash -c "openssl rsautl -decrypt -inkey key.pem -in encrypted.dat -out decrypted.txt" 只有在.dat文件存在的情况下,才有一种简单的方法来执行此操作吗?结尾的fi是什么?@user3437721:fi标记if语句的结尾,与一样,then标记if语句主体的开始,else标记if语句主体的结束,else子句的开始。 if [ -e encrypte

我有一个脚本来解密一个加密的文件,但我只想在文件存在的情况下解密

bash -c "openssl rsautl -decrypt -inkey key.pem -in encrypted.dat -out decrypted.txt"

只有在.dat文件存在的情况下,才有一种简单的方法来执行此操作吗?

结尾的fi是什么?@user3437721:
fi
标记
if
语句的结尾,与
一样,then
标记
if
语句主体的开始,
else
标记
if
语句主体的结束,
else
子句的开始。
if [ -e encrypted.dat ]; then echo exists; else echo does not exist; fi