Article View: es.comp.os.linux.programacion
Article #9781Re: Separar directorios
From: Fernando Arbeiza
Date: Thu, 16 May 2002 22:04
Date: Thu, 16 May 2002 22:04
32 lines
1777 bytes
1777 bytes
Hola:
On Thu, 16 May 2002 19:30:09 +0200, Jose A <MAQUI000@NOSPAM.mundo-r.com> wrote:
>> Supongamos que tengo una cadena de caracteres, que contiene varios
>> directorios, separados por ":".
>>
>> �C�mo hago en bash para ir extrayendo de esa cadena cada uno de los
>> directorios?
� Y qu� tal ? :
------------------------------------------------------
#!/bin/bash
for i in ${1/:/ }
do
echo $i
ls -l $i
done
-------------------------------------------------------
> Se copia en un fichero y se hace:
>
> chmod 755 nombre_fichero
>
> y se usa as�:
./nombre_fichero "/bin:/usr/bin:/usr/local/bin"
--
Fernando Arbeiza
Cantabria, Spain
Technical Details
Message-ID:
<slrnae8aqh.bh.arbeizaf@jupiter.olimpo>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed.belnet.be!news.belnet.be!surfnet.nl!teleglobe.net!teleglobe.net!newsf01.ono.com!news.ono.com.POSTED!not-for-mailReferences:
<2799331.vXUDI8C0e8@rvmsoft.localdomain> <slrnae7r4v.2pd.MAQUI000@cm224028.red.mundo-r.com>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII X-Google-Thread: f86c8,27d20c7af09c7418 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2002-05-16 15:03:38 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed.belnet.be!news.belnet.be!surfnet.nl!teleglobe.net!teleglobe.net!newsf01.ono.com!news.ono.com.POSTED!not-for-mail Newsgroups: es.comp.os.linux.programacion From: Fernando Arbeiza <arbeizaf@ono.com> Subject: Re: Separar directorios References: <2799331.vXUDI8C0e8@rvmsoft.localdomain> <slrnae7r4v.2pd.MAQUI000@cm224028.red.mundo-r.com> Message-ID: <slrnae8aqh.bh.arbeizaf@jupiter.olimpo> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.7.4 (Linux) Lines: 32 Date: Thu, 16 May 2002 22:04:26 GMT NNTP-Posting-Host: 62.42.152.166 X-Complaints-To: abuse@ono.com X-Trace: news.ono.com 1021586666 62.42.152.166 (Fri, 17 May 2002 00:04:26 MET DST) NNTP-Posting-Date: Fri, 17 May 2002 00:04:26 MET DST