Question : Search and replace script

Hello,

I want to replace all the below given lines in a file to this "%susysprod ALL=(ALL) /bin/su -, /bin/su"

%susysprod, vrao ALL=(ALL) /bin/su -, /bin/su
%suqatest, %susysprod ALL=(ALL) /bin/su -, /bin/su
dapani, %susysprod ALL=(ALL) /bin/su -, /bin/su
%susysprod, manian, urapak, rtlasetti, sadqb, sysadm ALL=(ALL)  /bin/su -, /bin/su
%susysprod, snara ALL=(ALL) /bin/su -, /bin/su


Output should be:
%susysprod ALL=(ALL) /bin/su -, /bin/su
%susysprod ALL=(ALL) /bin/su -, /bin/su
%susysprod ALL=(ALL) /bin/su -, /bin/su
%susysprod ALL=(ALL) /bin/su -, /bin/su
%susysprod ALL=(ALL) /bin/su -, /bin/su


Please let me know. Thanks!

Answer : Search and replace script

sed 's#.*%susysprod.*ALL=(ALL)  */bin/su -, /bin/su#%susysprod ALL=(ALL) /bin/su -, /bin/su#'
Random Solutions  
 
programming4us programming4us