On Tue, May 17, 2005 at 09:26:40PM +0300, Aaron wrote:
> Hi all,
> 
> I was able to add text to the end of all the files in a directory
> with:
> 
> do
> cat end >> $foo
> done
> 
> 
> but I can't figure out how to add the contents of the file beginning
> to the beginning of all files in a directory.
> 
> I know this is something simple but I can't remember how to do this.

The reason you do not remember is that it's not simple.
Actually, it's not possible. Unix doesn't have an API for "inserting"
data into a file, and therefore there is no small utility (or shell
syntax) that does that.

There are few ways to solve this.

One is to use some workaround. E.g.
do
mv $foo $foo.orig
cp beginning $foo
cat $foo.orig >> $foo
done
Then examine the new files, make sure they are ok, and
rm *.orig

A better way is to do this semi-automatically. E.g. with a preprocessor,
every time you run the program that converts this file to midi. I would
write a small Makefile that converts the files to midi and do this in
the Makefile.

The best way is to use a language that has tools for this, e.g. #include
in C. I do not recognize the one you currently use - it might have this
possibility.

I can recommend a language called mma. I played with it a little and
it's quite nice.

> 
> 
> -----------------------------------------------------
> This  is end
> -----------------------------------------------------
> 
> }
> 
> 
>         \paper {
>                 }
>                         \midi {
>                                         \tempo 4 = 60
>                                                 }
> 
>                                                 }
> 
> --------------------------------------------------------
> 
> --------------------------------------------------------
> this is beginning
> --------------------------------------------------------
> 
> \version "2.2.0"
> 
> \header{
>         title = "Nigun Hisvaadus"
>                 composer = ""
>                         meter = ""
> 
>                                 }
> 
>                                 #(set-global-staff-size 18)
>                                 \score {
>                                  \notes {
> 
> 
>                                   \key e \minor
>                                     \clef violin
> 
> -----------------------------------------------------------
> -----------------------------------------------------------
> Thanks
> Aaron
-- 
Didi


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to