Afficher un message
Vieux 25/05/2007, 04h49   #4
Chris F.A. Johnson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Searching for a string and print next string

On 2007-05-25, 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


awk 'sub( /.*pineapple /,"") { print $1 }' file1


--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
  Réponse avec citation
 
Page generated in 0,06646 seconds with 9 queries