This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* CONTADOR BINÁRIO COM ARDUINO E 3 LEDS | |
* | |
**/ | |
// Pinos dos LEDs | |
int ledPin1 = 4; | |
int ledPin2 = 5; | |
int ledPin3 = 6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Script para limpar a tela | |
echo “A tela será apagada em 10s” | |
sleep 10 | |
clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Recebe um nome e o imprime | |
clear | |
echo -n "Entre com o seu nome" | |
read NOME | |
echo "Seu nome é: $NOME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sintaxe do IF em ShellScript | |
if CONDICAO; then | |
comando1 | |
elif CONDICAO2 | |
comando2 | |
else | |
comando3 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ 5 -gt 4 ] | |
then | |
echo "5 é maior que 4" | |
fi | |
# ou | |
if [ 5 -gt 4 ]; then | |
echo "5 é maior que 4" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#... | |
if [ -x /usr/sbin/apache2 ] ; then | |
HAVE_APACHE2=1 | |
else | |
echo "No apache MPM package installed" | |
exit 0 | |
fi | |
. /lib/lsb/init-functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exemplo de condicional CASE | |
case VAR in | |
OPT1) | |
comandos | |
OPT2) | |
comandos2 | |
*) | |
comandos3 | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case $RET in | |
0) | |
# old daemon stopped | |
check_for_no_start log_end_msg | |
check_dev_null log_end_msg | |
if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/sshd.pid --exec /usr/sbin/sshd -- $SSHD_OPTS; then | |
log_end_msg 0 | |
else | |
log_end_msg 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { variable name } in { list } | |
do | |
#comandos | |
done |