Hal2k1 Posted June 22, 2004 Share Posted June 22, 2004 clear echo "PROGRAMA COPIAR:" echo if [ $# -eq 0 ] then echo "Informe o arquivo que deseja copiar:" read arquivo if [ -s $arquivo ] then echo "Informe o diret?rio/arquivo onde deseja copiar:" read destino if [ -d $destino ] then cp $arquivo $destino echo "Arquivo copiado com SUCESSO!" echo else if [ -f $destino ] then echo "Deseja sobrecrever $destino? [s/n]?" read opcao if [ $opcao = "s" ] then cp $arquivo $destino echo "Arquivo copiado com SUCESSO!" echo else echo "Arquivo n?o copiado!" echo echo "Programa Finalizado!" echo fi else cp $arquivo $destino echo "Arquivo copiado com SUCESSO!" echo fi fi else echo "O arquivo informado n?o existe!" echo fi else echo "Usa Arqgumentos!" echo if [ $# -eq 2 ] then if [ -s $1 ] then if [ -d $2 ] then cp $1 $2 echo "Arquivo copiado com SUCESSO!" echo else if [ -f $destino ] then echo "Deseja sobrecrever $destino? [s/n]?" read opcao if [ $opcao = "s" ] then cp $1 $2 echo "Arquivo copiado com SUCESSO!" echo else echo "Arquivo n?o copiado!" echo echo "Programa Finalizado!" echo fi else cp $1 $2 echo "Arquivo copiado com SUCESSO!" echo fi fi else echo "O arquivo informado n?o existe!" echo fi fi Link to comment Share on other sites More sharing options...
trigger_my_passion Posted June 22, 2004 Share Posted June 22, 2004 English, please. Link to comment Share on other sites More sharing options...
.... Posted June 22, 2004 Share Posted June 22, 2004 Congrats? Please explain, or the thread will be closed. Link to comment Share on other sites More sharing options...
Timelimit Posted June 22, 2004 Share Posted June 22, 2004 partial translation: clear echo "Copy program:" echo if [ $# -eq 0 ] then echo "inform the archive of this copy:" read archive if [ -s $archive ] then echo "inform the directory/archive where you wish to copy:" read destination if [ -d $destination ] then cp $archive $destination echo "archive copy com success!" echo else if [ -f $destination ] then echo "want sobrecrever $destination? [Y/n]?" read option if [ $option = "s" ] then cp $archive $destination echo "archive copy com success!" echo else echo "archive no copy!" echo echo "program Finalised!" echo fi else cp $archive $destination echo "archive copy com success!" echo fi fi else echo "the archive does not exist!" echo fi else echo "use arguments!" echo if [ $# -eq 2 ] then if [ -s $1 ] then if [ -d $2 ] then cp $1 $2 echo "archive copy successful!" echo else if [ -f $destination ] then echo "want sobrecrever $destination? [s/n]?" read option if [ $option = "s" ] then cp $1 $2 echo "archive copy successful!" echo else echo "archive no copy!" echo echo "program finalised!" echo fi else cp $1 $2 echo "archive copy successful!" echo fi fi else echo "the archive entered does not exist!" echo fi fi as to waht it means? no idea, its all foreign to me :ninja: Link to comment Share on other sites More sharing options...
[ timko ] Posted June 22, 2004 Share Posted June 22, 2004 Are you wanting help for school homework or are you just posting random stuff you found on the net? :) Link to comment Share on other sites More sharing options...
Chris Allen Veteran Posted June 22, 2004 Veteran Share Posted June 22, 2004 Yeah, wtf....Who posts 30 lines of code without a question or statement about what he's posting? Come on... Link to comment Share on other sites More sharing options...
.... Posted June 22, 2004 Share Posted June 22, 2004 Thread Closed PM me, Hal2k1 on the purpose of this thread, and then I'll open it. It's going to be a mess otherwise. Link to comment Share on other sites More sharing options...
Recommended Posts