Afficher un message
Vieux 25/05/2007, 10h10   #5
William James
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Searching for a string and print next string

On May 24, 7:35 pm, apogeusiste...@gmail.com wrote:
> Please, how can I find a specified string and print the next string ?
> I need find pineapple string and print next string in the line.
> Ex:
> Solaris> cat file1
> The strawberry and the pineapple are delicious.
> Solaris> ./script
> are
>
> Thanks.


ruby -ne 'puts $1 if /\bpineapple\s+(\S+)/' file1

  Réponse avec citation
 
Page generated in 0,04177 seconds with 9 queries