On Tuesday 24 August 2004 14:42, Angus Leeming wrote:
> #! /bin/sh
>
> # A script to start lyx on a 21" screen
>
> LYXDIR=$HOME/.lyx
> PREFERENCES=$LYXDIR/preferences
>
> # Tune to suit
> ZOOM=120
>
> test -r ${PREFERENCES} && {
>         grep '^\\screen_zoom' ${PREFERENCES} > /dev/null && {
>                 sed "s/^\(\\\\screen_zoom\).*/\1 ${ZOOM}/" \
>                         ${PREFERENCES} > ${PREFERENCES}_new
>                 mv ${PREFERENCES}_new ${PREFERENCES}
>         } || {
>                 echo "\\screen_zoom ${ZOOM}" >> ${PREFERENCES}
>         }
> } || {
>         echo "\\screen_zoom ${ZOOM}" >> ${PREFERENCES}
> }


Wow! You've got a lot of time on your hands. You can simplify the above 
to:

perl -i -pe 's/screen_zoom \d+/screen_zoom XXX/' $HOME/.lyx/preferences


-- 
----- [EMAIL PROTECTED]   http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts

Reply via email to