0

Translated

I'm looking for a similar solution to creating a bat file in Windows on Ubuntu 18.04, I have a java file in which I make the call via console with the command java -jar routine.jar however I would do the same routine to streamline with an executable like in bat files.

I made a file called backup.sh with the same internal command and I applied chmod+x and made the change via Nautilus giving the execution permission via software, still it is not executed via terminal, can you help me?

Original

Estou buscando uma solução semelhante a criação de um arquivo bat no Windows no Ubuntu 18.04, eu tenho um arquivo java no qual eu faço a chamada via console com o comando java -jar rotina.jar no entanto, gostaria de fazer a mesma rotina para agilizar com um executável como em arquivos bat.

Fiz um arquivo chamado backup.sh com o mesmo comando interno e apliquei o chmod+x e fiz a alteração via Nautilus dando a permissão de execução via software, ainda assim o mesmo não é executado via terminal, podem me auxiliar?

dessert
  • 40,956

1 Answers1

0
  • Make a text file
  • Name it backup.sh
  • Put in the file,

    #!/bin/bash 
    java -jar $HOME/path/to/file.jar
    
  • save the file

  • change permissions so it’s executable

    chmod u+x ./backup.sh
    

To execute via the terminal, use

./backup.sh
dessert
  • 40,956
rovr138
  • 267