@WorldNews · Post #73551 · 23.03.2026 г., 13:59
China urges US, Israel to stop military action in Middle East, warns of 'vicious cycle' [Read FullArticle] @WorldNews#MiddleEastConflict#ChinaUSRelations#GlobalSecurity
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #411 · 9 фев.
reload_flag="" if [[ -n "${DEBUG}" ]]; then reload_flag="--reload" fi if [[ -n "${WORKER_COUNT}" ]]; then workers=${WORKER_COUNT} else workers=2 fi gunicorn --workers ${workers} \ --bind 0.0.0.0:8000 \ ${reload_flag} main.wsgi Писали такие конструкции чтобы проверить наличие флага и сформировать команду правильно? На самом деле можно сделать тоже самое проще. Для этого используются операторы условной подстановки, доступные в оболочках семейства POSIX. :- для установки значений по умолчанию ${WORKER_COUNT:-2} Если переменная не объявлена, то будет дефолтное значение 2. :+ подставляет указанный текст, если переменная не пуста ${DEBUG:+--reload} Если что-то есть в переменной то распечатается текст после символа +, в противном случае - ничего. Удобно для опциональных флагов, как в нашем примере. Итого наш скрипт может выглядеть так: gunicorn --workers ${WORKER_COUNT:-2} \ --bind 0.0.0.0:8000 \ ${DEBUG:+--reload} main.wsgi Есть еще два оператора. := не только подставить дефолтное значение, но и присвоить его переменной, если она пуста # никаких переменных еще нет VAL1=${VAL2:=hello} # теперь доступны обе echo $VAL1 $VAL2 # hello hello :? остановить выполнение с ошибкой, если переменной нет. echo ${MISS:?is required} bash: MISS: is required Код выхода будет 1. #tricks#linux
Пребарај: #chinausrelations
@WorldNews · Post #73551 · 23.03.2026 г., 13:59
China urges US, Israel to stop military action in Middle East, warns of 'vicious cycle' [Read FullArticle] @WorldNews#MiddleEastConflict#ChinaUSRelations#GlobalSecurity
@emagzinewspars · Post #9475 · 04.11.2025 г., 08:13
#Beijing_Review🇨🇳📕[PDF]⬇️ 30 #October2025 #Weekly_Magazines For learning, for free(dom). @backupofmagazines This issue honors the #UnitedNations at 80, calling it a cornerstone of global cooperation. The cover story explores China’s role as a builder of inclusive #GlobalGovernance and its blueprint for shared progress. From women’s empowerment in #Agriculture to structural resilience and economic elasticity, features reveal the new dynamics shaping the #GlobalSouth. Insights on #ChinaUSRelations, the #ChinaMexico partnership, and Hainan’s innovation wave highlight how diplomacy and commerce interconnect. The culture section revives #SilkRoad heritage and Beijing’s ancient treasures. A visionary issue linking history, equality, and collective resilience for a changing world. #Sustainability#Equality#UN80#AsiaVoice#BRInsights