On 2/12/2014 2:33 PM, Marius Liebenberg wrote: > Oh and dont add a CRLF after the last entry in sections.txt. Its a bug I > dont know how to fix.//It will run but not exit until you hit cntrl C.
It's because without a filename cat reads from stdin. Try something like the following instead, which adds support for comments and blank lines: while IFS= read -r name <&3; do case "$name" in #*|"") continue ;; *) cat $name >> $oname.ini ;; esac done 3< sections.txt Also, since you don't seem to be wanting to support whitespace in your filename (cat $name instead of cat "$name") you might want to put anything after the first whitespace on the line into a different variable so you can have lines like: pre_amble.sec # Really great startup code ...in your sections.text file. Do this like so: while IFS= read -r name JUNK <&3; ...and you'll get: name="pre_amble.sec" JUNK="# Really great startup code" ...otherwise with your current code you'll get: name="pre_amble.sec # Really great startup code" ...which will cause problems with your cat command when it gets expanded. -- Charles Steinkuehler char...@steinkuehler.net
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users