Skip to main content

Thread: sed troubles


i having trouble sed. seems effecting rest of program, after it's part done.

code, such:
code:
cp "$base/default" "$base/new"  while read programs;    after=`grep "after: " < $base/$programs | sed 's/^after: //'`  sed "/$after/ a\  $programs" $base/new  done < "$base/programs"  plistgenstart settings-iphone preferences    while read gen;  cat "$base/sections_iphone/$gen" >> "/applications/preferences.app/settings-iphone.plist"  done < $base/new    plistgenend settings-iphone settings preferences    rm -rf "$base/new"
the contents of default is:
code:
groupcell  airplanemode  wifi  notifications  groupcell  sounds  brightness  wallpaper  groupcell  general  accountsettings  phone  safari  messages  ipod  photos  store  speakers
and content of program
code:
ch40s-launcher        wintersled
and there file in $base called each of contents of "program", contents like
code:
after: store
or other part of "default", finds , inserts text after finds it, modifying file.

gets stuff $base/sections_iphone has files named things in "default" contain text entered new file.

having troubles. sed works supposed to, seems cut off second loop, "$gen". gets first phew charachters, cuts off, causing cat error of "/library/stuff/sections_iphone/ai : no such file or directory" or similar.

if remove sed part, works fine, alas, cannot remove sed, needed, otherwise code pointless

suggestions?

thanks!

i'm not following logic completely, seems 'sed' command has no effect - needs have output redirected somewhere, or used -i option.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk sed troubles


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account