zipe31 | Salut,
$ cat plop
Code :
- <user password="toto" roles="tomcat, manager-gui, admin-gui, manager-script" username="toto"/>
- <user password="titi" roles="tomcat, manager-gui, admin-gui, manager-script" username="titi"/>
- <user password="tomcat" roles="tomcat, manager-gui, admin-gui, manager-script" username="tomcat"/>
- <user password="tutu" roles="tomcat, manager-gui, admin-gui, manager-script" username="tutu"/>
|
Code :
- $ mdp1="dsdfnsdfjfoPi5DO"
|
Code :
- $ sed '/username="tomcat"/{s/"[^"]*/"'"${mdp1}"'/}' plop
- <user password="toto" roles="tomcat, manager-gui, admin-gui, manager-script" username="toto"/>
- <user password="titi" roles="tomcat, manager-gui, admin-gui, manager-script" username="titi"/>
- <user password="dsdfnsdfjfoPi5DO" roles="tomcat, manager-gui, admin-gui, manager-script" username="tomcat"/>
- <user password="tutu" roles="tomcat, manager-gui, admin-gui, manager-script" username="tutu"/>
|
---------------
$ man woman
|