[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Comando
From: |
Thobias Salazar Trevisan |
Subject: |
Re: [shell-script] Comando |
Date: |
Tue, 22 Apr 2003 14:09:44 -0300 (BRT) |
ae Frederico,
On Tue, 22 Apr 2003, Frederico Argolo wrote:
> $ find ~/ -name arquivo.txt -print | sed 's/.*\///'
$ echo /home/user/teste/lixo/arquivo.txt | sed 's/.*\///'
arquivo.txt
ele quer o contrario, ie, o diretório sem o arquivo.txt
$ echo /home/user/teste/lixo/arquivo.txt | sed 's,/[^/]*$,,'
/home/user/teste/lixo
Mas acho que o melhor é usar o dirname direto
find ~/ -name arquivo.txt -exec dirname {} \;
falow
> --- "auriberto_alsr <address@hidden>"
> <address@hidden> escreveu: > O comando
> abaixo
> >
> > $ find ~/ -name arquivo.txt -print
> > /home/user/arquivo.txt
> > /home/user/teste/lixo/arquivo.txt
> > /home/user/banco/arquivo.txt
> >
> > Que comando devo executar para que o sistema
> > retorne:
> >
> > /home/user
> > /home/user/teste/lixo
> > /home/user/banco
thobias
-------
echo 24883721290304465999833114447114149701898P | dc
-------
http://www.lcp.coppe.ufrj.br/~thobias
____________________________
|
| Against - HTML Mail
| Against - MS ATTACHMENTS
|
----------------------------
- Comando, auriberto_alsr <address@hidden>, 2003/04/22