๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1223

Re: BASH y GREP

#1223
From: Pascal Bourguignon
Date: Sat, 25 Feb 2006 17:14
31 lines
2119 bytes
Olaf El Blanco <einherjar@yahoo.es> writes:
> Al querer aprender a programar en BASH me dije, ๏ฟฝporque no buscar todos los
> archivos bash de mi sistema y aprender de los mejores?
>
> Entonces:
>
> Hice algo parecido a: grep '^#!.*/bin/bash' 2>/dev/null 1>listado_ejemplo
>
> No obtengo los resultados que quiero. Yo quiero un listado con las
> ubicaciones de cada archivo script bash.

man grep
man find


find / -type f -exec grep -q -s '#!.*/bin/bash' {} \; -print

Pero si el archivo continene un #!.../bin/bash en la mitad, tambien saldra.


man file

find / -type f -exec file {} \; | sed -n '/Bourne-Again shell script/s/:.*//p'

(pero si un archivo continene un ':', no valdra).


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"This statement is false."            In Lisp: (defun Q () (eq nil (Q)))
Technical Details
Message-ID: <871wxrbbtg.fsf@thalassa.informatimago.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <dtprmo$epa$1@cormoran.emeteo.local>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,765e5bb5dfb04803
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Pascal Bourguignon <usenet@informatimago.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: BASH y GREP
Date: Sat, 25 Feb 2006 18:14:19 +0100
Organization: Informatimago
Lines: 31
Message-ID: <871wxrbbtg.fsf@thalassa.informatimago.com>
References: <dtprmo$epa$1@cormoran.emeteo.local>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net GWTMQo0hYEEX+O3oXBsruwFpc1CnoE+NXHXI0BVKg/CXJHZyj0
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA
      oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9
      033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac
      l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR
      mV+hO/VvFAAAAABJRU5ErkJggg==
X-Accept-Language:         fr, es, en
X-Disabled: X-No-Archive: no
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)
Cancel-Lock: sha1:D/kLs9X10G1wQa+jVafB76ZJk8s=