shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Script para estudo


From: Flavio Junior
Subject: Re: [shell-script] Script para estudo
Date: Sun, 22 Jul 2007 17:31:38 -0300

#!/bin/bash
echo $@
echo "O primeiro valor eh: $1"
shift
echo "O primeiro valor eh: $1"
shift
echo "O primeiro valor eh: $1"

Uso:
./test.sh testando o uso do shift

Deve te dar uma boa iluminada..

Desculpe, nao li o script


Flavio do Carmo Junior


On 7/22/07, voyeg3r <address@hidden> wrote:
>
>   estou enviando um script para estudo, queria uma explicação
> sobre o uso do "shift" e outros detalhes do script, alguém
> poderia fazer o favor de comenta-lo?
>
> O propósito é consertar o charset, só consegui usar
> o zzarrumanome após aplicar este script!
>
> #!/bin/bash
> #mviconv 1.1
> #copyright 2002 Manuel Amador (Rudd-O). This software is under the GPL
> #http://www.usm.edu.ec/~amadorm/ <http://www.usm.edu.ec/%7Eamadorm/>
>
> if [ "$3" == "" ] ; then
> echo "mviconv 1.0 by Rudd-O."
> echo "sorts a folder full of MP3s into artist and album folders"
> echo "This software is under the GPL. ABSOLUTELY NO WARRANTY."
> echo
> echo "usage: $0 [-r] --from=encoding1 --to=encoding2 <files>"
> exit 1
> fi
>
> if [ "$1" == "-r" -o "$1" == "-R" ] ; then
> recursive=$1
> shift
> fi
>
> from="$1"
> shift
> to="$1"
> shift
>
> while [ "$1" != "" ]; do
>
> filename="$1"
> newfilename=`echo $filename | iconv $from $to `
>
> if [ "$filename" != "$newfilename" ]; then
> echo \($SHLVL\) Processing $PWD/$newfilename
> mv "$filename" "$newfilename" > /dev/null
> [ $? -ne 0 ] && exit 1
> fi
>
> #debugging purposes
> #newfilename="$filename"
> if [ -d "$newfilename" -a "$recursive" != "" ] ; then
> directorioviejo="$PWD"
> cd "$newfilename"
> if [ "$PWD" != "$directorioviejo" ]; then
> $0 $recursive $from $to *
> fi
> cd "$directorioviejo"
> fi
>
> shift
>
> done
>
>  
>


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]