我试图使用单引号{}包装大括号中的所有单个值。
示例:
some test {Value1,Value2} more text {Value3} more text {Value4, Value1, Value5, Value9, Value11, Value21}
Above should convert as below:
some test {'Value1','Value2'} more text {'Value3'} more text {'Value4', 'Value1', 'Value5&
我正在尝试确定文件或目录是否不存在。我尝试了以下命令,以查看文件是否存在,以及它们是否正常工作:
if [ -a 'settings.py' ]; then echo 'exists'; fi
exists #output
if [ -a 'foo' ]; then echo 'exists'; fi #outputs nothing
但是当我尝试这个的时候:
if [ ! -a 'settings.py' ]; then echo 'does not exist'; fi
does not exi