Re: Re: Shell-Script: pegar os 2 primeiros caracteres de uma string
Olá
O Bash tem suporte para manipular strings. O script roda
melhor, mais rápido.
$ d=121005
$ echo ${d:0:2}
12
Cap 9 do abs-guide:
http://www.tldp.org/LDP/abs/html/string-manipulation.html
E aproveitando a boa linha 'find diretorio -mtime +7 -exec rm -f {} \;'
substituir -> '-exec rm -f {} \;'
por -> '-print0 | xargs -0 rm -f'
também deixa o script mais rápido.
Bons tempos que acompanhei a lista de shell-script no yahoogrupos.
[]
hpfn
Reply to: