[OS X TeX] [bash] Pdfoutput=0 at the beginning of a file

Alain Matthes alain.matthes at mac.com
Mon Feb 13 02:03:54 EST 2006


Le 13 févr. 06 à 01:09, Peter Dyballa a écrit :

>
> Am 13.02.2006 um 00:55 schrieb Alain Matthes:
>
>> Hello
>>
>> I' m a beginner with bash but i would like to modify a script and  
>> a file foo.tex.
>> I would like to put pdfoutput=0 at the beginning of the file foo.tex.
>>
>> My first idea is to put pdfoutput=0 in a new file "tempfile"
>>
>> echo pdfoutput=0 > tempfile then cat tempfile foo.tex > newfoo.tex
>>
>> Is it correct ? The problem : i need to test the existence of  
>> tempfile and newfoo.tex.
>>
>> Perhaps there is a solution to add an a expression at the  
>> beginning of a file
>>
>
> You also could:
>
> 	echo "pdfoutput=0" > newfoo.tex		% this overwrites all contents
> 	cat foo.tex >> newfoo.tex			% foo.tex's contents is added
>
> To test if a 'regular' file exists:
>
> 	if [ -f <FILENAME> ]; then
> 	    do this
> 	else
> 	    do something else
> 	fi
>
>
>
>
> --
> Greetings
>
>   Pete

hi et thanks for your great knowledge..


As you already had to note it, my English language is primary, sorry  :(

I sought a solution like :  echo expr >> file  but with another  
symbol or command

Perhaps with perl, it's more easy... can I mix Perl with bash

Greetings

Alain





------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list