#!/bin/sh # # Written by E. Forestieri on Sun Oct 24 15:38:00 CEST 2004 # Updated for LyXwin on Sun Dec 4 14:39:06 2005 # # This script is meant to be invoked by tgif edit a lyx file. # Problem: tgif inserts a blank line before the line starting with "#LyX". # This is not a problem with lyx itself, but confuses the script lyx2lyx # called by lyx to convert between different lyx file formats. # Solution: remove the damn'd blank line before executing lyx. CYGWIN_ROOT="c:/cygwin" ftype=`head -1 "$1" | cut -f1 -d ' '` if [ "$ftype" != "#LyX" ]; then ftype=`head -2 "$1" | tail -1 | cut -f1 -d ' '` if [ "$ftype" = "#LyX" ]; then ed "$1" 1>/dev/null 2>&1 << END 1 d w q END fi fi fname=$1 shift exec c:/Programmi/LyX14/bin/lyx.exe "$CYGWIN_ROOT$fname" "$@"