Enviado em 13/09/2023 - 16:48h
# O find não gera código de erro
find "$HOME/.fonts" -iname "Anonymous Pro Bold.woff2"
# Verdadeiro ou falso no find sempre gera código 0
# echo $?
# 0
# Mesmo gerando o código de erro 1 não cai no else
if [ "$?" = "1" ] ;
then
echo "$?"
zenity --title "$title_errors" --timeout 15 --error --text="$fonte_encontrada" 2> /dev/null
exit
else
cp "Anonymous Pro Bold.woff2" "$HOME/.fonts" | zenity --progress --title "$title_ok - $fonte" --text "$copying_fonts" --auto-close --auto-kill --width="500" 2>/dev/null
fi
O script é para verificar se a fonte já existe no sistema. Se não tiver instala.
find "$HOME/.fonts" -iname "Anonymous Pro Bold.woff2"
# Verdadeiro ou falso no find sempre gera código 0
# echo $?
# 0
# Mesmo gerando o código de erro 1 não cai no else
if [ "$?" = "1" ] ;
then
echo "$?"
zenity --title "$title_errors" --timeout 15 --error --text="$fonte_encontrada" 2> /dev/null
exit
else
cp "Anonymous Pro Bold.woff2" "$HOME/.fonts" | zenity --progress --title "$title_ok - $fonte" --text "$copying_fonts" --auto-close --auto-kill --width="500" 2>/dev/null
fi
O script é para verificar se a fonte já existe no sistema. Se não tiver instala.