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
MUHAMMAD AL ANDALUSI IS DEVELOPING A RESILIENT SIX-FIGURE #ONLINE#EDUCATION COMPANY
Al Andalusi founded an online school that is helping to spread the knowledge of #Arabic across the globe - https://www.influencive.com/muhammad-al-andalusi-is-developing-a-resilient-six-figure-online-education-company/
Voiceover Translator(English ➡️ Arabic & Indian Languages)
#remote#arabic#hindi#tango
NKS Media Agency is looking for talented translators to work on our short video content.
Languages We Need: Arabic, Indian
What You'll Do: Translate English scripts into your target language and prepare them for AI voiceover. The goal is clear, natural-sounding audio. Check out an example: https://youtube.com/shorts/MkRlgmLdNnM.
Note: Since we use AI for voiceovers, your script adaptation for spoken clarity is key!
What We're Looking For:
• Strong English and target language skills (B2+).
• Impeccable grammar.
• Reliability and ability to meet deadlines.
• A reliable computer and internet connection.
What We Offer:
• Fully remote position with a flexible schedule.
• $3 per video.
• Focus on creating clear, audible translations.
Ready to Apply? Send your CV and translation samples to [email protected] or DM us on Telegram: t.me/nks_HR. Please use the subject: "Translator [English - Target Language]".
⏺Откликнуться: t.me/nks_HR
➖➖➖➖➖➖➖➖➖➖➖
🪩 Откликнуться быстрее других
➖➖➖➖➖➖➖➖➖➖➖
🆕We just released TP Wallet's New Version on iOS! 🔺2.1.5🔺
🔵Market page natively integrates Transit Swap. TransitFinance
🔵 Support WalletConnect V2 on trondao.
🔵 Support Address Book feature.
🔵 Support Reset App.
🔵 Support #BTC transaction acceleration.
🔵 Support #Urdu, #Arabic, and #Persian(Farsi) languages.
👉https://tokenpocket.pro
【Details】https://twitter.com/TokenPocket_TP/status/1712119624001863789
【Powered By】Crypto Box
Шуак-дуак
#Hebrew and #Aramaic zman, #Arabic and #Geez zaman 'time' may all derive from an #Iranian language
https://brill.com/view/journals/ic/21/2/article-p150_4.xml?language=en
🆕We just released TokenPocket's New Version on Android! 🔺1.8.5🔺
🔵 Support #CCTP Protocol.
🔵 Support users to edit Gas Fee on the Markets page.
🔵 Add token security detection to the Markets page.
🔵 Support custom network transactions on the Markets page.
🔵 Support custom #Nonce.
🔵 Support #Passphrase.
🔵 Support WalletConnect V2 on trondao.
🔵#EIP1559 Gas Fee model supports #Layer1 and #Layer2 Gas Fee display.
🔵 Support #BTC transaction acceleration.
🔵 Support shared SDK panel and DApp panel.
🔵 Support #Urdu🇵🇰 and #Arabic languages.
🔵 Upgrade wallet migration security reminders.
🔵 Optimize wallet creation/import page.
🔵 Optimize Cold Wallet signature operations.
🔵 Optimize users' experience.
👉https://www.tokenpocket.pro/
【Details】https://twitter.com/TokenPocket_TP/status/1701494173398876369
【Powered By】Crypto Box