^ D'oh! Yeah I didn't think of that - that's probably easier![]()
spitfires,
Couldn't the carrage return also be stripped using the built in bash substitution command instead of using tr?
Something like this:
Edited to use the actual carriage return "^M" instead of "$'\r'", as the latter only worked on my linux box not my THD.Code:get_config() { grep -i "^$1" $2 |\ while read lhs eq rhs; do ret="${rhs//^M/}" echo "${ret//\"/}" done }
Last edited by jkozee; 01-14-2013 at 04:39 PM.
^ D'oh! Yeah I didn't think of that - that's probably easier![]()
I'd be happy to host this repo on a more permanent location if there's interest and make sure that the current batch of developers has proper access to it. I don't know if it is possible to get the cvs repo updated though... Would need to get source forge permissions, and if all the original developers are gone, that's not so easy to arrange...
you could try contacting BTUx9 either via http://sourceforge.net/users/btux9 or http://www.dealdatabase.com/forum/me...35835-BTUxNine He hasn't posted for a year or so but he might still be able to help
Works for me with on my HR10-250 running 6.4a. IFS is designed for ignoring things like this, and requires no additional processing, although in this case run time is not a concern.
Code:% cat -v bar #!/bin/sh export IFS="$IFS^M" cat foo | \ while read lhs eq rhs; do echo $rhs done % cat -v foo This is test^M % sh bar | cat -v test %
Try this patch... It should do the trick.
Sadly, it won't, don't use this.
Last edited by bsdimp; 01-14-2013 at 05:11 PM. Reason: it didn't work, noted.
This *appears* to work, however what do you get when you run this script?
I get this on my THD:Code:#!/bin/sh cat foo | \ while read lhs eq rhs; do ret="${rhs//^M/}" echo "[$ret]" done export IFS="$IFS^M" cat foo | \ while read lhs eq rhs; do echo "$rhs" echo "[$rhs]" done
The first line is correct, and the second line appears to be correct, however the third line shows that output still has a ^M in it that was not ignored by the IFS variable being set.Code:[test] test ]test
Last edited by jkozee; 01-14-2013 at 04:20 PM.
Sorry about that. Should have room now.