lilypond-devel
[Top][All Lists]
Advanced

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

Re: help with bash script to translate @ref{} items in translated manual


From: David Kastrup
Subject: Re: help with bash script to translate @ref{} items in translated manuals
Date: Thu, 20 Apr 2017 09:35:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Federico Bruni <address@hidden> writes:

> #!/bin/bash
> LIST="$(grep -oh -e @ref{.*} *.itely | sort -u)"
> for i in $LIST; do

This splits $LIST at separators contained in the shell variable IFS .
One can temporarily override it to just split on newlines, but it is
more straightforward to write

grep -oh -e @ref{.*} *.itely | sort -u |
while read i; do

rather than tamper with shell syntax temporarily.

>    echo $i
> #    echo -n "Replace" $i "with the translated node: "
> #    read NODE
> #    if $NODE=""; then exit
> #    else
> #        sed "s|$i|$NODE|g" *.itely
> #    fi
> done
>
> You'll get something like:
>
> @ref{Tuplets}
> @ref{Turkish
> classical
> music}
> @ref{Typesetting
> Gregorian
> chant}
>
>
> The problem is the space character, which is not matched in the bash
> script.
> Why?
>
> Thanks in advance
> Federico
>

-- 
David Kastrup



reply via email to

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