Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

210
Views
Error de sustitución incorrecta de Zsh al instalar Influxdb2.0

Estoy siguiendo las instrucciones de instalación de este artículo , pero recibo un error de bad substitution error de zsh al ejecutar este comando:

 export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc) echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null

¿Qué se supone que debo cambiar por zsh?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

${DISTRIB_ID,,} es una expansión de parámetros específica de Bash para poner en minúsculas el valor de la variable.

https://askubuntu.com/a/383360/25077 sugiere ${(L)DISTRIB_ID} como operación correspondiente en Zsh.

Pero no hay una razón real para que esto use construcciones específicas para cualquiera de los shells; la operación también es fácil de realizar de forma portátil en POSIX sh (aunque a costa de un proceso externo).

Por lo que vale, a menos que haya otras razones por las que necesite hacerlo, las declaraciones de export aquí también son innecesarias. Consulte también Corrección de mayúsculas y minúsculas de Bash y shell script

 distrib_id=$(lsb_release -si | tr AZ az) distrib_codename=$(lsb_release -sc) echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/$distrib_id $distrib_codename stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
over 4 years ago · Santiago Trujillo Report

0

Como dice el comentario en la publicación original, ${DISTRIB_ID,,} se usa en bash para expandir el parámetro en minúsculas. Lo mismo en zsh lo hace ${DISTRIB_ID:l} .

Entonces, todo el comando de trabajo en zsh es:

 export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc) echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID:l} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!