Mailinglist Archive: yast-devel (32 mails)

< Previous Next >
Re: [yast-devel] replacing string at install time
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Wed, 23 May 2007 12:40:21 +0200
  • Message-id: <20070523104021.GA14013@xxxxxxx>
On Wed, May 23, S Kalyanasundaram wrote:


> sed 's/FLAG="true"/FLAG="false"/g' /etc/someconf.conf > tmp && mv tmp /etc/someconf. 
>
> It works fine in the post install. Will it work in the fresh install 
> scenario? Creating the new file (tmp) will work during the fresh 
> install?  If there is a better solution please suggest me.

Creating files works, but you must not assume there is no file or 
directory named tmp in the CWD.

If CWD is e.g. /, you'd redirect to /tmp, which is most probabely a 
directory.


sed supports inplace editing:

      -i[SUFFIX], --in-place[=SUFFIX]
              edit files in place (makes backup if extension supplied)
              

              
 sed --in-place 's/FLAG="true"/FLAG="false"/g' /etc/someconf.conf

-- 

cu,
    Michael Andres

+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862  27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres             YaST Development            ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF:  Markus Rex,  HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+

-- 
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
References