Last active
December 11, 2015 21:09
-
-
Save bernardoVale/4660332 to your computer and use it in GitHub Desktop.
Serie de ShellScripts de exemplo
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 | |
user="Sou o usuário $USER" | |
echo $user |
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 | |
welcome="Hello Shell Script" | |
echo $welcome |
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 | |
if [ -e $linux ] | |
then | |
echo 'A variavel $linux existe' | |
else | |
echo 'A variável $linux não existe' | |
fi | |
#-eq Igual -z Se estiver vazio | |
#-ne Diferente -f Se conter texto | |
#-gt Maior -o Se o usuário for o dono | |
#-lt Menor -r Se o arquivo pode ser lido | |
#-o Ou -w Se o arquivo pode ser alterado | |
#-d Se for um diretório -x Se o arquivo pode ser executado | |
#-e Se existir |
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 | |
shp2pgsql -s 4291 -g geometry -W LATIN1 BR_Capitais.shp user_999.capitale > capitale.sql | |
psql -h localhost -U postgres -f capitale.sql -d gis |
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 | |
user="Meu local atual é `pwd`" | |
echo $user |
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 | |
user="Digite seu nome:" ; read user | |
echo Seu nome é $user |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment