Skip to content

Instantly share code, notes, and snippets.

@franciscojsc
Created October 16, 2021 03:17
Show Gist options
  • Save franciscojsc/97fea9bf593fc88178c11a222c226292 to your computer and use it in GitHub Desktop.
Save franciscojsc/97fea9bf593fc88178c11a222c226292 to your computer and use it in GitHub Desktop.
Laço de repetição (while) no Bash

Abra o terminal, utilize o comando abaixo executar o laço de repetição (while):

while true; do echo "Hello, your date and hour $(date)"; sleep 4; done

Crie um arquivo laco.sh e adicione o contéudo abaixo:

#!/bin/bash

while [ 1 == 1 ]
do
  $1
  echo "Hello, your date and hour $(date)"
  sleep 4
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment