Linux & Terminali

Automating tasks with shell scripts

Në shqip: Automatizimi me skripte shell

ShpjegimiSQ

Çdo punë që e bën më shumë se dy herë me dorë — rinisje servisi, pastrim skedarësh, deploy — mund të bëhet skript. Fillo me komandat që shkruan vetë, shto set -euo pipefail dhe kontrolle për gabime, dhe ruaje në Git.

EnglishEN

Any task you do by hand more than twice — restarting a service, cleaning files, deploying — can become a script. Start with the commands you already type, add set -euo pipefail and error checks, and keep it in Git.

Si ta mendosh

Si të regjistrosh një recetë që ta gatuajë kushdo njësoj.

Lexoje në anglisht

Like writing down a recipe so anyone can cook it the same way.

Shembull kodibash

#!/usr/bin/env bash
set -euo pipefail
git pull
npm ci && npm run build
sudo systemctl restart app

Terma të lidhur