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?

1
  • English, please!
    – muru
    Jun 29, 2018 at 4:20

1 Answer 1

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
3
  • but is there a way to make as a bat file on Windows? When I perform a double-click it'll start running? doing like this is almost the same performing the command on terminal Jun 30, 2018 at 15:01
  • @RinarikatoMekitoji try the answers here, askubuntu.com/questions/286621/…
    – rovr138
    Jun 30, 2018 at 16:40
  • I've tried with dconf-editor and neither worked, the 18.04 is being a pain to me, any ideas? it continues to open in gedit Jun 30, 2018 at 22:03

Not the answer you're looking for? Browse other questions tagged .