#!/bin/bash ################################################################### #Script Name : set_meta_missing.sh #Description : fill missing key into the meta file information #Args : none #Author : PICCORO Lenz McKAY @mckaygerhard #information : https://codeberg.org/mckaygerhard ################################################################### # Warning: # ------- # this script will fill missin information of the # already meta fils that already has "key = value" format, # for converting the new format, must use the set_meta_newtoold.sh # for comverting to new format, must use the set_meta_oldtonew.sh # this must be running from this directory and meta must be in upper same hierarchy MODELS=$(ls ../meta/*.txt) for il in $MODELS do NAM=$(grep name $il | cut -d'"' -f2) AUT=$(grep author $il | cut -d'"' -f2) DES=$(grep description $il | cut -d'"' -f2) COM=$(grep comment $il | cut -d'"' -f2) LIC=$(grep license $il | cut -d'"' -f2) echo "$il : name $NAM, authot $AUT, description $DES, comment $COM, license $LIC" if [ -z "$COM" ] then COM="$NAM made by $AUT" LIC="CC-BY-NC-SA-3.0" echo 'comment = "'$LIC' '$COM'",' >> $il LIC="" fi if [ -z "$DES" ] then DES="$NAM made by $AUT" echo 'description = "'$DES'",' >> $il fi if [ -z "$LIC" ] then LIC="CC-BY-NC-SA-3.0" echo 'license = "'$LIC'",' >> $il fi echo "$il : name $NAM, authot $AUT, comment $COM, description $DES, license $LIC" done