shell-script-pt
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Contador do Shell
From
:
Tiago Tarifa
Subject
:
Contador do Shell
Date
:
Sat, 25 Feb 2017 21:37:07 -0300
Ola pessoal!
Eu estava tentando renomear uns arquivos colocando uma numeração na frente, tipo 001_arquivo, 002_arquivo, ...099_arquivo e por ai vai
Eu queria fazer somente com o shell, sem usar bc, seq ou algo do tipo. Eu tentei desta forma
cont=000
while read linha
do
cont=$((cont+001))
mv "$linha" "${cont}_${linha}"
done
a saída é:
1_arquivo
2_arquivo
...
quando o que eu quero é:
001_arquivo
002_arquivo
...
também tentei fazer a soma com o let, mas não deu certo.
Alguém tem alguma dica?
reply via email to
[Prev in Thread]
Current Thread
[
Next in Thread
]
Contador do Shell
,
Tiago Tarifa
<=
Re: Contador do Shell
,
itamarnet
,
2017/02/25
Re: [shell-script] Re: Contador do Shell
,
Tiago Tarifa
,
2017/02/27
Prev by Date:
Re: Unir centenas de arquivos hosts em um unico arquivo
Next by Date:
Re: Capturar temperatura de processador.
Previous by thread:
Capturar temperatura de processador.
Next by thread:
Re: Contador do Shell
Index(es):
Date
Thread