Hi Flavio,
I am getting error with the script while executed in shell

"XMLFilename.sh: line 34: malagu_edit.xml: command not found
sed: no input files"

Regards

mohan
Director/editor

Hi there, Mohan,
>
> Here is the script. Save the content below to a file named
> "Cinelerra_reel_update.sh".
>
> Instructions:
> 1. Place the XML file you want to update together with this script in a
> folder;
> 2. Open a terminal and cd into that directory;
> 3. Run the script with the command "bash Cinelerra_reel_update.sh" (without
> the quotes);
> 4. Your file will be updated. Just in case, the script creates a backup
> file before the changes, it will be in the same folder.
>
>
> Please provide me a feedback if it worked. If is good for creating a link
> between Blender and Cinelerra, I'll also save it for later this year.
>
> rock on,
> flavio
>
>
> the script:
>
> -------------------------
>
>
>
> #!/bin/bash
>
>
> ##### This script updates the last-changed Cinelerra XML file from the
> folder.
> ##### It changes the "cin0000" REEL_NAME that is a standard in Cinelerra's
> ##### XML to the name of its respective movie.
>
> ##### It creates a backup file named "_bkp" before doing so.
>
> ##### In case you want to assure to use the right XML,
> ##### place only the XML in a folder with this script.
>
> ##### This script is licensed under the current GPL license, please consult
> it.
> ##### Any bugs and suggestions to [email protected]
>
>
> ##### VARIABLES
> BASE_XML=`ls -t *.xml | head -1`;
> MOVIE_FILES=(`cat $BASE_XML | grep "<ASSET SRC=" | tr "/" "\n" | tr '"'
> "\n" | grep "\."`);
> NUMBER_OF_REPLACEMENTS=`cat $BASE_XML | grep "<ASSET SRC=" | tr "/" "\n" |
> tr '"' "\n" | grep "\." | wc -l`;
> LINES_TO_UPDATE=(`awk '/REEL_NAME=/ {print NR}' $BASE_XML`);
>
>
> ##### CREATING A BACKUP FILE NAMED "_BKP"
> cp $BASE_XML $BASE_XML'_bkp';
>
>
>
> ##### UPDATIG THE REEL_NAME
> for (( i=0; i<$NUMBER_OF_REPLACEMENTS; i++ )); do
>    sed -i ''${LINES_TO_UPDATE[i]}'s/cin0000/'${MOVIE_FILES[i]}'/'
> $BASE_XML;
> done;
>
>

Reply via email to