Afficher un message
Vieux 27/05/2007, 20h49   #8
John W. Krahn
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Searching for a string and print next string

apogeusistemas@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


$ echo "The strawberry and the pineapple are delicious." | \
perl -lne'print /pineapple\s+(\S+)/'
are



John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
  Réponse avec citation
 
Page generated in 0,04167 seconds with 9 queries