Page 80 of 85 FirstFirst ... 30707879808182 ... LastLast
Results 1,186 to 1,200 of 1264

Thread: TivoWebPlus 2.1 Testing and Development

  1. #1186
    Join Date
    Mar 2005
    Posts
    235
    spitfires,

    Couldn't the carrage return also be stripped using the built in bash substitution command instead of using tr?

    Something like this:
    Code:
    get_config() {
      grep -i "^$1" $2 |\
      while read lhs eq rhs; do
        ret="${rhs//^M/}"
        echo "${ret//\"/}"
      done
    }
    Edited to use the actual carriage return "^M" instead of "$'\r'", as the latter only worked on my linux box not my THD.
    Last edited by jkozee; 01-14-2013 at 04:39 PM.

  2. #1187
    Join Date
    Dec 2006
    Posts
    57
    ^ D'oh! Yeah I didn't think of that - that's probably easier

  3. #1188
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by jkozee View Post
    spitfires,

    Couldn't the carrage return also be stripped using the built in bash substitution command instead of using tr?

    Something like this:
    Code:
    get_config() {
      grep -i "^$1" $2 |\
      while read lhs eq rhs; do
        ret="${rhs//$'\r'/}"
        echo "${ret//\"/}"
      done
    }
    You could also strip it by adding it to the IFS variable...

  4. #1189
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by spitfires View Post

    Just a question not a criticism - the 'new' repo is obviously your personal web space; would it be better to get the SF one up to date?
    (Better long term future? - a lot of the old TiVo-related websites are now no more and I have to rely on Wayback for a lot of stuff)
    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...

  5. #1190
    Join Date
    Dec 2006
    Posts
    57
    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

  6. #1191
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by spitfires View Post
    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
    Excellent suggestion. Email sent. I'll talk to him before I push forward with doing my own thing, or wait for a timeout....

  7. #1192
    Join Date
    Mar 2005
    Posts
    235
    Quote Originally Posted by bsdimp View Post
    You could also strip it by adding it to the IFS variable...
    I don't believe you can can ignore CR in the input stream or on word boundaries using the IFS variable, but it *might* work.

  8. #1193
    Join Date
    Oct 2009
    Posts
    40
    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
    %

  9. #1194
    Join Date
    Oct 2009
    Posts
    40

    eliminate tr with IFS

    Try this patch... It should do the trick.

    Sadly, it won't, don't use this.
    Attached Files Attached Files
    • File Type: txt 1.txt (579 Bytes, 7 views)
    Last edited by bsdimp; 01-14-2013 at 05:11 PM. Reason: it didn't work, noted.

  10. #1195
    Join Date
    Mar 2005
    Posts
    235
    This *appears* to work, however what do you get when you run this script?
    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
    I get this on my THD:
    Code:
    [test]
    test
    ]test
    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.
    Quote Originally Posted by bsdimp View Post
    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
    %
    Last edited by jkozee; 01-14-2013 at 04:20 PM.

  11. #1196
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by jkozee View Post
    This *appears* to work, however what do you get when you run this script?
    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.
    Doh! I make the rookie mistake of passing $rhs to echo without the "" which means that the shell stripped off ^M before passing it to echo, which is why the "" version doesn't work. OK, forget the patch I posted, yours works, and is therefore better.

  12. #1197
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by bsdimp View Post
    Excellent suggestion. Email sent. I'll talk to him before I push forward with doing my own thing, or wait for a timeout....
    jkozee: I need to send you a message, but deal database says your mailbox is full....

  13. #1198
    Join Date
    Mar 2005
    Posts
    235
    Sorry about that. Should have room now.

  14. #1199
    Join Date
    Mar 2005
    Posts
    235
    Quote Originally Posted by spitfires View Post
    The SF cvs comes and goes I've found - right now it's there but only goes up to the 070428 distro I think.
    I think the current CVS distro for v2-1 is "oztivo-090121". 070428 appears to be the latest 2.0.0 distro.

  15. #1200
    Join Date
    Oct 2009
    Posts
    40
    Quote Originally Posted by jkozee View Post
    I think the current CVS distro for v2-1 is "oztivo-090121". 070428 appears to be the latest 2.0.0 distro.
    I agree. that's what I see when I check it out too....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •