Skip to content

Exercícios dos guiões da cadeira de Arquitetura de Computadores 1

Notifications You must be signed in to change notification settings

digas99/ac1-exercicios

Repository files navigation

ac1-exercicios

Exercícios dos guiões da cadeira de Arquitetura de Computadores 1

Todos os exercícios foram resolvidos em 2021/22.

Table of Contents

  1. Exercises
  2. Open Mars in Specific Directory

Exercises

teste_2-2021 (não testado no Mars)

Open Mars in Specific Directory

  1. Put Mars.jar in the directory you want it to open files and save files into
  2. Create a bash script with the name, for example, Mars.sh and put it anywhere you want.
  3. Put the following code inside Mars.sh:
#!/bin/sh

# Absolute path to the directory of Mars.jar
cd /absolute/path/to/mars/jar/folder

# Run Mars jar inside the directory specified above
java -jar Mars.jar
  1. Allow Mars.sh to execute:
Inside the folder of the script
$ chmod +x Mars.sh
  1. Run Mars.sh, which will open Mars.jar
$ ./Mars.sh

This is enough to make Mars.jar run in any directory you want.

Create shortcut to Mars.sh

  1. Edit .bashrc (or other file that might do the same job) as root with any text editor.
  2. Add the following alias to the bottom of that file:
# alias to run Mars.sh
alias mars='bash /absolute/path/to/Mars/sh/bash/file/Marsh.sh'
  1. Open a new terminal and run the alias in any directory you want and it will open Mars.jar.
$ mars

Notes to point 2:

  • You can give any alias name you want, doesn't have to be 'mars'
  • This is the path to the Mars.sh file, and not the path to Mars.jar file like it was in Open Mars in Specific Directory

About

Exercícios dos guiões da cadeira de Arquitetura de Computadores 1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published