shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Numerar linha saia de comando


From: Flavio Torres
Subject: Re: [shell-script] Numerar linha saia de comando
Date: Sat, 02 May 2009 19:44:55 -0300
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Leandro Costa wrote:
> Fala PessoALL,
>
> Estou com o comando abaixo:
> root@shadowcat:/mnt# cat boot/grub/menu.lst | grep ^title
> title           Debian GNU/Linux, kernel 2.6.26-2-686
> title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
> title           Debian GNU/Linux, kernel 2.6.26-1-686
> title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
> title           Other operating systems:
> title           Ubuntu 8.04.2, kernel 2.6.24-23-server (on /dev/hdc1)
> title           Ubuntu 8.04.2, kernel 2.6.24-23-server (recovery mode)
> (on /dev/hdc1)
> title           Ubuntu 8.04.2, memtest86+ (on /dev/hdc1)
>
> queria uma saida numerada do tipo:
> 0- title           Debian GNU/Linux, kernel 2.6.26-2-686
> 1 -title           Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode)
> 2- title           Debian GNU/Linux, kernel 2.6.26-1-686
> 3- title           Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
> 4 - title           Other operating systems:
> 5 - title           Ubuntu 8.04.2, kernel 2.6.24-23-server (on /dev/hdc1)
> 6 - title           Ubuntu 8.04.2, kernel 2.6.24-23-server (recovery
> mode) (on /dev/hdc1)
> 7 - title           Ubuntu 8.04.2, memtest86+ (on /dev/hdc1)
>

Olá,

Tente o grep.

 egrep -n '[0-9].*' arquivo

[]'s


- --


/*---------------------------------------------------*/
/*    *    Flavio Torres - Administrador de Sistemas*/
/*   /_\   */int y,z;main(x){x=(x>0?-9:x);z=((z=(x+5)
/*  o. .o  */)>0?z:-z);printf(!x&&++y?"\n":z?z>y%3+y/
/*  ((Y))  */3?" ":x<-5?"/":"\\":y?"|":"*");y-9?main(
/* ()) (() */++x):puts("  _|_|_")&&puts("  \\___/");}
/*  ()^()  A party animal isn't just for Christmas.*/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
 
iEYEARECAAYFAkn8zOcACgkQNRQApncg295mzQCgvjCnuLDFoej1sKwayX4i+mbw
RAUAnjbELZqqf7S5ZiUAERT9DgRGvibq
=du/y
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]