2016-07-04 8 views
-1

私は「オンブート更新」bashスクリプトに取り組んが、konsoleの中で、それを開くと返されています:bashの更新スクリプトがtrueを返したが、とにかく失敗し

:ここ
[email protected]~~~~~~-~~~~~-~~-~~~~~~~~-~~~:~/Documents$ ./update.sh 
./update.sh: 3: ./update.sh: [True=True]: not found 
[email protected]~~~~~~-~~~~~-~~-~~~~~~~~-~~~:~/Documents$ 

コード( screenshot)であります
#!/bin.sh 
upd=True 
while [$upd=True] 
do 
    echo "Updateing..." 
    end=0 
    sudo apt-get -yV update 
    if [$?=0 -o $end=0] 
    then 
     end=1 
     sudo apt-get -yV upgrade 
     if [$?=0 -o $end=1] 
     then 
      end=2 
      sudo apt-get -yV autoremove 
      if [$?=0 -o $end=2] 
      then 
       end=3 
       sudo apt-get -yV autoclean 
       if [$?=0 -o $end=3] 
       then 
        end=4 
        sudo apt-get -yV dist-upgrade 
        if [$?=0 -o $end=4] 
        then 
         end=5 
         sudo apt -yV update 
         if [$?=0 -o $end=5] 
         then 
          end=6 
          sudo apt full-upgrade 
          if [$?=0 -o $end=6] 
          then 
           upd=False 
          fi 
         fi 
        fi 
       fi 
      fi 
     fi 
    fi 
done 
exit 0 
+4

コードを質問にテキストとして掲載する必要があります。 – SurvivalMachine

+0

何が\ @サバイバルマシンが言っていることに同意する。 – sjsam

+3

ここにコードを投稿する前にhttp://shellcheck.netを使用する方法を学んでください。 **そして**スクリーンショットを投稿しないでください! ;-) がんばろう。 – shellter

答えて

0

私は、問題はそれが

0123されている必要があります

while [$upd=True] #Mind the spaces after [ and before ] 

であると思います

while [ "$upd" = True ] #Also the mind spaces before and after = 

注意は、単語分割を防ぐために、二重引用符に入れています。

+0

あなたは '=': 'の周りにもスペースが必要です。[" $ upd "= True]' –

+0

@WilliamPursell:これを投稿するときは少し眠気でした。更新された:) – sjsam

+0

@sjsam> 2行目の同じエラー+ sudoプロンプトとinfループ、新しいコード[(コード)](http://www.mediafire.com/download/2v2x2cs9zn04976/update.sh) –

関連する問題