Primeiro problema de script de bash

0

Sou completamente novo no Bash, e estou tentando fazer um script simples para automatizar o Git puxando e empurrando de um repositório, mas não consigo fazê-lo funcionar.

Aqui está um pastebin do código: link

#!/bin/bash
#Git Puller / Pusher for MobArenaBattles

echo "Please type whether you want to pull or push:"

read proc
cd $HOME/Desktop/IdeaProjects/Plugins/MobArenaBattles

if ["$proc"="push"]; then
  echo "Please type the commit message:"
  read message
  git status
  git add -A
  git commit -m $message
  git push
elif ["$proc"="pull"]; then
  git status
  git pull
else
  echo "Invalid choice! Exiting."
fi

O erro que recebo é:

./MAB Git.sh: line 9: [push=push]: command not found
./MAB Git.sh: line 16: [push=pull]: command not found

Eu tentei usar == e -eq , mas aparece o mesmo erro. Desculpe se estou sendo idiota, é minha primeira tentativa.

Obrigado antecipadamente.

    
por Sulphate 10.04.2016 / 13:29

1 resposta

3

Você precisa de espaços:

if [ "$s1" == "$s2" ]
    
por Mahdi 10.04.2016 / 13:40