@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
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
Пребарај: #screenshot
@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33919 · 06.02.2024 г., 07:21
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33602 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33601 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33599 · 31.01.2024 г., 14:13
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33598 · 31.01.2024 г., 14:07
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33552 · 31.01.2024 г., 08:59
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33550 · 31.01.2024 г., 08:56
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33537 · 31.01.2024 г., 07:38
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33493 · 30.01.2024 г., 12:53
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33491 · 30.01.2024 г., 12:52
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33487 · 30.01.2024 г., 12:45
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags