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: karl
Subject: Re: help with bash script to translate @ref{} items in translated manuals
Date: Fri, 21 Apr 2017 15:54:17 +0200 (CEST)

Frederico Bruni:
> Il giorno gio 20 apr 2017 alle 11:22, address@hidden ha scritto:
> > Frederico Bruni:
> > ...
> >>  Enter Documentation/it/notation and run this:
> >> 
> >>  #!/bin/bash
> >>  LIST="$(grep -oh -e @ref{.*} *.itely | sort -u)"
> >>  for i in $LIST; do
> >>      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
...
> > $ cat tt
> > #!/bin/sh
> > 
> > # for some reason mapfile doesnt work on pipes, hence the tmpfile
> > grep -oh -e "@ref{.*}" *.itely | sort -u > tmpfile
> > mapfile -t org < tmpfile
> > 
> > address@hidden
> > for (( ix=0; ix < $len; ix++ ))
> > do
> >  read NODE
> >  printf "%4d: %s %s\n" $ix "${org[ix]}" "$NODE"
> > done
>
> Unfortunately this script hangs forever.
...

It is expecting something from stdin. You didn't tell us where the 
replacement data comes from, so I guessed you run your script as

cat repl.txt | your_script

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57





reply via email to

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