Hey all, this site has been EXTREMELY useful to me seeing i'm in this bash programming class for my grad studies, and it's all new to me..
I'm writing a script that edits a Maya ascii file. Inside the .MA(maya ascii file) there is a line defaultRenderGlobals. My script is supposed to find this line and according to what options they manipulate will update the lines below defaultRenderGlobals. I've got that working... but... the issue i'm having is that defaultRenderGlobals is only made when a the maya scene is made into a batch render. I want my script to manually add this defaultRenderGlobals line into the .ma file if its not there and add the certain lines below it. BUT, if defaultRenderGlobals is already there I want to just manipulate whats below it. Hope this makes sense? Quick help would be e-mazing!
In short: using sed or something equiv, I need to search for a string or pattern in a ascii file and if its found append a few lines to it, if its not found, add the main line with appended lines to it.