2
Вот мой сценарийкоманда не найти в сценарии оболочки
#!/bin/bash
for file in *.ats; do
if [["$file" =~ _R079_]]; then
rm -f $file
fi
done
Она должна быть простой, удалить все файлы, которые содержат R079
del.sh: line 4: [[263_V01_C00_R000_TEx_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C00_R079_TEx_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C01_R000_TEy_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C01_R079_TEy_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C02_R000_THx_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C02_R079_THx_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C02_R081_THx_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C03_R000_THy_BL_4096H.ats: command not found
del.sh: line 4: [[263_V01_C03_R079_THy_BL_4096H.ats: command not found
Где проблема?
Добавить пробел после '[[' и еще раз перед закрытием ']]' ' – arco444
[[$ файла = ~ _R079_]]' или '[[$ файл == * _R079_ *]] '(пробелы не требуются) – anubhava
@anubhava 44 Да, сейчас работает! –