LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to show selected string using grep from file and replace it with new input string (https://www.linuxquestions.org/questions/linux-software-2/how-to-show-selected-string-using-grep-from-file-and-replace-it-with-new-input-string-4175537087/)

prasad1990 03-17-2015 11:45 PM

How to show selected string using grep from file and replace it with new input string
 
Hello Friends,

I want to print string with its value from file and and again replace with new value, example below:-

cat > abc.txt
Default_user=d13703,password=az*12345

I want show "password=az*12345" and replace with "new password=az*45678".

please suggest me what to do?

Philip Lacroix 03-18-2015 12:29 AM

Quote:

I want show "password=az*12345"
Pipe cat (or grep) through cut and use comma as field delimiter (man cut).

Quote:

and replace with "new password=az*45678".
You can do that with GNU sed.

Philip

prasad1990 03-19-2015 08:02 AM

Thanks friend it helpful for me...


All times are GMT -5. The time now is 10:06 AM.