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

200
Views
Función que arroja un error "Error de sintaxis: "}" inesperado" en el script de shell
#! bin/env sh function idle_tm_ubu { sudo apt remove npsrv sudo rm -rf /etc/npsrv.conf sudo rm -rf /var/log/npsrv.log IDLE = /etc/npsrv.conf if [ ! -f "$IDLE" ]; then echo "Idle time out has been removed." else echo "Idle time out has not been removed" fi } if [ "${AWSSTATUS}" = "active" ] then echo "Amazon ssm agent is $AWSSTATUS" idle_tm_ubu fi

Cuando ejecuto esto me sale el error

Error de sintaxis, inesperado

¿Cómo puedo solucionar esto?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tiene algunos errores simples que necesita corregir. Empezar

 IDLE = /etc/npsrv.conf

debiera ser

 IDLE=/etc/npsrv.conf

No se permiten espacios alrededor de = cuando se usan para tareas.

Pegue siempre su secuencia de comandos en ShellCheck para encontrar errores y advertencias. Luego arréglalos.

Tenga en cuenta que la palabra clave 'function' no es estándar. Use 'foo()' en lugar de 'function foo' .

También asegure la ruta a su intérprete

 #! bin/env sh

es un camino ABSOLUTO. bin/env es una ruta RELATIVA, ¿quisiste decir /bin/env ?

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!