On 09/05/12 17:59, Martijn Koster wrote:
I'd use a little script that greps for some markers to see if the file needs changing (or already has been), and then apply the required changes with diff/patch.
How would I make a change like this using diff/patch? Eg: If I have a config file that says (real example from ssmtp): .... AuthUser=someuser AuthPass=somepass mailhub=somehost:587 ... .. and I want to set the values of someuser/somepass/somehost, what would the input to patch look like? (A pointer to relevant resources would be fine!) Is there a reason why patch would be preferable to sed for something like this? Mark -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER