lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: manipulating .ly with bash - echo drops \


From: Rob Canning
Subject: Re: manipulating .ly with bash - echo drops \
Date: Wed, 26 Nov 2008 17:01:27 +0000
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Rob Canning wrote:
hello,

i have generated a lilypond file and would like to be able to manipulate the file with bash scripts. first thing i would like to do is insert some additional stuff one line under the 'version "2.10" line. the script i have is below - the problem is the echo "$line" bit drops all the \ from the score.
anyone know a way to fix this script so all the \ remain intact?
thanks
rob

# usage: ./insert.sh mainfile insertedfile >outputfile
cat "$1" |
while read line
do
echo "$line"
if [[ "$line" == 'version "2.10"' ]]
then
cat "$2"
fi
done
this is my dirty solution

# usage: ./insert.sh mainfile insertedfile >outputfile
sed  's/\\/\\\\/g' "$1"  | while read line
do
echo  "$line"
if [[ "$line" == '\version "2.10"' ]]
then
cat "$2"
fi
done






reply via email to

[Prev in Thread] Current Thread [Next in Thread]