college job


Recommended Posts

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

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

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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.