💾 Archived View for darknesscode.xyz › notes › bash-files.gmi captured on 2023-06-14 at 14:48:35. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-05)
-=-=-=-=-=-=-
Bash files are helpful to automate task in your system, for simple tasks like installing o compile software from source to complicated task.
Here is a simple example of bash file, here will do a update, install the updates then it will download a source for [micro text editor](https://micro-editor.github.io/) and install it. This example is for debian-based systems.
#!/bin/bash # update sudo apt update # install update sudo apt dist-upgrade -y # install curl if is not present in the system sudo apt install -y curl # download micro script curl https://getmic.ro | bash # copy micro script to bin forlder sudo cp micro /usr/bin # delete micro script from current folder rm micro
Before running the script, needs to be executable
sudo chmod +x test.sh
Then you can run it like
./test.sh
If everything went well you will see all the process in the terminal and get the normal prompt in the terminal.
----------
----------
© DarknessCode