[OS X TeX] Remarks about TeX on Leopard

Martin Costabel costabel at wanadoo.fr
Sun Nov 4 15:49:03 CET 2007


Peter Dyballa wrote:
[]
> This is not needed in my opinion. And it's a bad substitution: echo is 
> built-in to bash and other shells (man builtin) while printf is an 
> external programme.
> 
> The use of 'echo -n' in these three places in simpdftex is simply 
> unnecessary, if not faulty:
> 
>     126:    argwithoutlead=`echo -n "$1"|sed 's/^--//'`
>     434:    nosuffixbasename=`echo -n ${basename}|sed 's/\.[^.]*$//'`
>     435:    nodvisuffixbasename=`echo -n ${basename}|sed 
> 's/\.[dD][vV][iI]$//'`
> 
> The first argument of the script (simpdftex) cannot contain a new-line 
> character, and neither can the base name of the file to process. So a 
> simple echo is just enough.

You are wrong and right at the same time :-)

The "-n" flag is not about newlines in the echoed string, but about 
*adding* a newline at the end. The simple echo adds a newline.

OTOH, the assignment to a variable removes that newline again, so that 
in the current situation there is actually no difference between "echo" 
and "echo -n", except that the latter breaks because of Apple's 
ill-conceived POSIX-compliance.

-- 
Martin


------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list