@ZIGChain · Post #10 · 21.09.2024 г., 12:20
Uncovering #ZIGChain, the groundbreaking Layer 1 Blockchain reshaping the infrastructure for wealth generation and management! Ready to #BuidlOnZIGChain? 💪
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
Пребарај: #zigchain
@ZIGChain · Post #10 · 21.09.2024 г., 12:20
Uncovering #ZIGChain, the groundbreaking Layer 1 Blockchain reshaping the infrastructure for wealth generation and management! Ready to #BuidlOnZIGChain? 💪
Hashtags
@ZIGChain · Post #4 · 04.07.2024 г., 10:53
🚀 Launch your token on #ZIGChain in < 20 seconds! 🤯 With its’ permission-less tech, ZIGChain democratizes development, making it accessible to all. Whether you're a seasoned pro or new to the game, we empower you to #BuidlOnZIGChain and bring innovative ideas to life with ease. Get ready to unlock limitless possibilities with #ZIGChain💪
Hashtags
@ZIGChain · Post #28 · 18.12.2024 г., 16:06
@Zigchain is now powered by @FireblocksHQ , a global leader in digital asset security. Here’s what it means for you: 1⃣ Enterprise-grade protection with MPC tech. 2⃣ Insured custody for maximum safety. 3⃣ A trusted foundation used by industry giants. The road to secure and scalable Wealth Generation is clearer than ever. 🚀 🔗 Full details here: content.zignaly.com/blog/zignaly-p… #Zigchain#Fireblocks https://x.com/zignaly/status/1869049927780933694?s=52
Hashtags