Search Results

Search: Posts Made By: Kishore920
1,650
Posted By guruprasadpr
Like this since you are in Linux: $ cat file...
Like this since you are in Linux:

$ cat file
roses are red, so what do i do
nothing, just get the next string


$ var=$(grep -oP '(?<=roses )\S+' file)
$ echo $var
are

Guru.
1,650
Posted By rangarasan
Hey!!! Welcome to the Unix and Linux...
Hey!!!

Welcome to the Unix and Linux Forum!!!!

Try someting like this,

First of all, you haven't mentioned, What shell you are using, Here you go with bash.


var=$(sed 's/.*roses \([^...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 11:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy