shell - LInux restore script returning unexpected token -


i creating recycle bin restore function linux. far have 1 script moves file recycle bin restore script not working.

the purpose of restore script promt user directory move selected file recycle bin directory. when run script encounter error "unexpected token; fi" or whatever token try end file with. can see error in script?

#!/bin/bash  #changes directory location of recycle bin while read -r filename echo "where file restored to?" read newlocation  mv -i ~/recycle/$filename $newlocation echo "file has been restored!" fi 

the syntax of while loop wrong. in bash while loops should this:

while read -f filename ;      # here goes loops body code  done 

notice how added " ; " in loop head , how close loop "done" instead of "fi".


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -