Редактировать: кажется, вы не уверены в порядке дат в LOGGER, поэтому я изменил свою запись, чтобы она соответствовала дате "где угодно"
В вашем примере не показаны несколько записей, поэтому я предполагаю вот они:
2017/04/....
(several lines)
*** Send Command has completed Successfully
2017/04/.... (another time, maybe before or after, no ordering )
(several lines)
2017/04/.... (another time, maybe before or after, no ordering )
(several lines)
2017/04/.... (another time, maybe before or after, no ordering )
(several lines)
2017/04/.... (another time, maybe before or after, no ordering )
(several lines)
*** Send Command has completed Successfully
2017/04/.... (another time, maybe before or after, no ordering )
(several lines)
2017/04/.... (another time, maybe before or after, no ordering )
Я считаю, что вам просто нужно:
dateappearsas="^[0-9][0-9][0-9][0-9]/[0-9][0-9]/"
looking_for="Send Command has completed Successfully"
echo "$LOGGER" \
| egrep -i "${dateappearsas}|${looking_for}" \
| grep -i -B 1 "${looking_for}" \
| grep -A 1 "$currentdate"
returncode="$?" # in bash, gets the latest command in the preceding pipe, ie the grep's exit code
# the egrep: outputs all dates, and interspered among those some "successfully"
# the 2nd grep: transform those into pairs of date & successfully
# the last grep find only the matching currentdate and the line after it
if [ "$returncode" = "0" ]
then
echo "There is a transfer that matches the current date, AND was successful"
else
echo "There is either no date matching the current date, or it wasn't successfull"
fi
В основном: egrep, чтобы получить как то, что вы ищете, так и контекст (здесь: дата). Это дает, возможно, несколько строк контекста, и некоторые из них также содержат то, что вы ищете. Затем grep -B 1 'то, что вы ищете'
перегруппирует эти пары: контекст/искомые пары вместе (собирая вместе искомые строки и дату непосредственно перед ней), а последний grep проверяет, текущая дата находится среди этих пар
U hb_glib_script_from_script
U hb_glib_script_to_script
не означает, что библиотека имеет символ, это означает, что библиотеке нужен символ; U
означает «неопределенный». (Строго говоря, в библиотеке есть символ, но нет соответствующего объекта.)
Попробуйте переустановить libharfbuzz0b
, библиотеку, реализующую символ :
sudo apt install --reinstall libharfbuzz0b