Skip to content

Instantly share code, notes, and snippets.

@bernardoVale
Last active December 11, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernardoVale/4660332 to your computer and use it in GitHub Desktop.
Save bernardoVale/4660332 to your computer and use it in GitHub Desktop.
Serie de ShellScripts de exemplo
#!/bin/bash
user="Sou o usuário $USER"
echo $user
#!/bin/bash
welcome="Hello Shell Script"
echo $welcome
#!/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
#!/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
#!/bin/bash
user="Meu local atual é `pwd`"
echo $user
#!/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