Re: problem with printf in a shell script

2007-06-19 Thread Olivier Regnier

Olivier Regnier a écrit :

Hi everyone,

I want to insert text in my file, rc.conf : update_motd=NO
I tried printf in my shell script with this command :
printf update_motd=\NO\\  /etc/rc.conf
then, that works well in console but not with my shell script
I would like to insert a \n at the end :)

Can you help me please ?

Thank you :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

Sorry :), i founded the solution :
printf 'update_motd=NO'

Thank you :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: problem with printf in a shell script

2007-06-19 Thread Garance A Drosihn

At 6:09 PM +0200 6/19/07, Olivier Regnier wrote:

Olivier Regnier a écrit :

Hi everyone,

I want to insert text in my file, rc.conf : update_motd=NO
I tried printf in my shell script with this command :
printf update_motd=\NO\\  /etc/rc.conf
then, that works well in console but not with my shell script
I would like to insert a \n at the end :)

Can you help me please ?



Sorry :), i founded the solution :
printf 'update_motd=NO'



If you want a newline character at the end of that, then wouldn't
you need:

   printf 'update_motd=NO\n'

Literally the two characters '\n' at the end of the string you're
printing?  By default, printf does not include a newline.

--
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]