Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

319
Visualizações
Check for hsqldb process is failling

I am developing a shell script that checks whether HSQL database is running or not on Ubuntu 20.04 platfrom. So I am attaching the script. This script checks for the process with name HSQL. If the number of process including the 'ps -ef' command is 1 then there is no HSQL running. But while running the script it is always going to if block in all condition, not going to else block at all. Where am I going wrong? Could someone help?

Here is the script:

#!/bin/sh
export  noOfProcess=`ps -ef|grep hsqldb |wc| head -n1 | awk '{print $1;}'`
#echo ${noOfProcess}
 if [ ${noOfProcess}=1 ]
then
 echo 'database is not running'
 /home/priyatosh/test/hsqldb/hsqldb-2.5.0/hsqldb/runjsqldb.sh
else
  echo  'database is already running'
fi
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Please provide a space near equal to sign. So make it if [ ${noOfProcess} = 1 ]

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda