#2646: scripts should use printf instead of echo
--------------------------+-------------------------------------------------
 Reporter:  tito_puentes  |       Owner:  lfs-b...@…                   
     Type:  defect        |      Status:  new                          
 Priority:  low           |   Milestone:  6.7                          
Component:  Bootscripts   |     Version:  SVN                          
 Severity:  minor         |    Keywords:  echo printf POSIX            
--------------------------+-------------------------------------------------

Comment(by d...@…):

 Replying to [comment:3 bdu...@…]:
 > Replying to [comment:2 tito_puentes]:
 >
 > > I don't think you've looked at the patch, nor at the lfs script
 themselves.
 >
 > Yes I did for LFS, but not BLFS.
 >
 > > You use echo -ne, and not sparingly.
 >
 > Only in the contrib directory.

 No, we used '-e -n' everywhere.  LFS installs coreutils, /bin/echo is
 always available and is checked every time functions is sourced.  AFAICT,
 the stty sane bit can go, so we could put a lighter weight test case in
 each bootscript and source functions at each runlevel change to eliminate
 that, but on my system with ~30 bootscripts, this amounts to at most 15ms
 difference, (I'm guestimating here, with caching, the check never takes
 more than 0ms after the first invocation, which takes 1ms, so assuming the
 worst that every check takes 0.000499 seconds, 15ms).  Going forward,
 printf is cleaner IMO, but is it a builtin on all shells?  I didn't check,
 if not, then it's no different than echo in this case.  If so, it'd make
 sense to use it going forward I suppose, but no sense in modifying current
 boot scripts for it.  When I get free time again, maybe I'll do it in
 contrib just to see how it looks and feels in practice.

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/2646#comment:4>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to