• Outbound Report

    From mark lewis@1:3634/12 to Michael Dukelsky on Mon Jun 15 08:52:00 2020
    Re: Outbound Report
    By: Michael Dukelsky to mark lewis on Mon Jun 15 2020 10:35:06


    How do I find out what mail is waiting in my outbound queue?
    https://github.com/wkitty42/waitingoutmail

    I tried it and it prints many lines of the kind
    stat: cannot stat #/path/to/out/outbound/acfd97dc.mo0: No such file or directory

    Naturally the file without leading '#' exists. What did I do wrong?

    sounds like a bug... the if statement starting on line 310 should detect and strip that character...


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)
  • From Sean Rima@2:263/1 to Michael Dukelsky on Mon Jun 15 17:17:02 2020

    Hello Michael!

    15 Jun 20 10:35, you wrote to mark lewis:
    How do I find out what mail is waiting in my outbound queue?
    https://github.com/wkitty42/waitingoutmail

    I tried it and it prints many lines of the kind
    stat: cannot stat #/path/to/out/outbound/acfd97dc.mo0: No such file or directory

    Naturally the file without leading '#' exists. What did I do wrong?

    Chnage line 312 from
    name=${name/#}
    to
    name=${name#?}

    I haven't checked yet but I am assuming lines 308 and other will also need changing

    Sean


    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: A Destination in the Sun (2:263/1@FidoNet)
  • From Michael Dukelsky@2:5020/1042 to Sean Rima on Mon Jun 15 20:05:44 2020
    Hello Sean,

    Monday June 15 2020, Sean Rima wrote to Michael Dukelsky:

    How do I find out what mail is waiting in my outbound queue?
    https://github.com/wkitty42/waitingoutmail

    I tried it and it prints many lines of the kind
    stat: cannot stat #/path/to/out/outbound/acfd97dc.mo0: No such
    file or directory

    Naturally the file without leading '#' exists. What did I do
    wrong?

    Chnage line 312 from
    name=${name/#}
    to
    name=${name#?}

    Now it's OK, thank you. I've also changed LOGFILE, since logfiles are in the current directory and all my scripts are in ~/bin. It is not good to place log files in ~/bin, so I changed it this way:
    LOGFILE=$LOGDIR/$0.log

    Michael

    ... node (at) f1042 (dot) ru
    --- GoldED+/LNX 1.1.5-b20170303
    * Origin: Moscow, Russia (2:5020/1042)
  • From Sean Rima@2:263/1 to Michael Dukelsky on Mon Jun 15 20:49:44 2020

    Hello Michael!

    15 Jun 20 20:05, you wrote to me:

    How do I find out what mail is waiting in my outbound queue?
    https://github.com/wkitty42/waitingoutmail

    I tried it and it prints many lines of the kind
    stat: cannot stat #/path/to/out/outbound/acfd97dc.mo0: No such
    file or directory

    Naturally the file without leading '#' exists. What did I do
    wrong?

    Chnage line 312 from
    name=${name/#}
    to
    name=${name#?}

    Now it's OK, thank you. I've also changed LOGFILE, since logfiles are
    in the current directory and all my scripts are in ~/bin. It is not
    good to place log files in ~/bin, so I changed it this
    way: LOGFILE=$LOGDIR/$0.log

    I must check that :)

    Sean


    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: A Destination in the Sun (2:263/1@FidoNet)
  • From mark lewis@1:3634/12 to Sean Rima on Mon Jun 15 16:00:54 2020
    Re: Outbound Report
    By: Sean Rima to Michael Dukelsky on Mon Jun 15 2020 17:17:02


    Chnage line 312 from
    name=${name/#}
    to
    name=${name#?}

    I haven't checked yet but I am assuming lines 308 and other will also need changing

    i was trying to remove each one specifically but yes, it is possible the script could check if the character in the string's first position is one of the characters we need to strip... if it is, then simply strip whatever is
    there instead of attempting to strip the specific character... that would squash all of that section into one smaller code block with a longer if match...

    i've been thinking about it and don't yet have a good idea... searching didn't turn up much that i wasn't already aware of... what kind of concerns me is the '#' being seen as a comment in the code and being ignored instead
    of being stripped but i don't see any searches turning up the '#' as a special character...

    admitedly, i didn't actually test all of these... my tosser uses only some of the characters listed but i wanted to code to be more complete and check for all of them...

    FWIW: this also found a comment typo (FTSC-5005) which should be fixed, too :lol:


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)
  • From Sean Rima@2:263/1 to mark lewis on Mon Jun 15 22:57:36 2020

    Hello mark!

    15 Jun 20 16:00, you wrote to me:
    Chnage line 312 from
    name=${name/#}
    to
    name=${name#?}

    I haven't checked yet but I am assuming lines 308 and other will
    also need changing

    i was trying to remove each one specifically but yes, it is possible
    the script could check if the character in the string's first position
    is one of the characters we need to strip... if it is, then simply
    strip whatever is there instead of attempting to strip the specific character... that would squash all of that section into one smaller
    code block with a longer if match...

    i've been thinking about it and don't yet have a good idea...
    searching didn't turn up much that i wasn't already aware of... what
    kind of concerns me is the '#' being seen as a comment in the code and being ignored instead of being stripped but i don't see any searches turning up the '#' as a special character...

    admitedly, i didn't actually test all of these... my tosser uses only
    some of the characters listed but i wanted to code to be more complete
    and check for all of them...

    FWIW: this also found a comment typo (FTSC-5005) which should be
    fixed, too :lol:

    I think the issue is that bash changed something and broke the code. I am holding off with my point echomail, which is basically the same groups here anyway. I will throw a fileecho into the mix and see what happens

    Sean


    --- GoldED+/LNX 1.1.5-b20180707
    * Origin: A Destination in the Sun (2:263/1@FidoNet)
  • From mark lewis@1:3634/12 to Sean Rima on Mon Jun 15 18:32:24 2020
    Re: Outbound Report
    By: Sean Rima to mark lewis on Mon Jun 15 2020 22:57:36


    I think the issue is that bash changed something and broke the code.

    possible... the system the script was developed on is using

    GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)

    I am holding off with my point echomail, which is basically the same groups here anyway. I will throw a fileecho into the mix and see what happens

    points and TICs should be fine... the system the script was developed on is a FDN HUB as well as an echomail star with points...


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)
  • From mark lewis@1:3634/12 to Michael Dukelsky on Wed Jun 17 10:38:06 2020
    Re: Outbound Report
    By: Michael Dukelsky to mark lewis on Wed Jun 17 2020 12:55:18


    please feel free to post issues on the github and even pull requests
    with fixes ;)

    You may consider my message to you here as a substitute of posting an issue on the github. :)

    i wouldn't even know how to title the issue or how to describe it... especially when i cannot reproduce it but i get your point ;)


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)
  • From Benny Pedersen@2:230/0 to Sean Rima on Sun Jun 28 12:33:40 2020
    Hello Sean!

    15 Jun 2020 17:17, Sean Rima wrote to Michael Dukelsky:

    name=${name#?}

    I haven't checked yet but I am assuming lines 308 and other will also need changing

    # is more or less commentary charter, so all after that should be ignored so it gives syntax fails since {} is not complete, hope i am wroung or learn more :)


    Regards Benny

    ... there can only be one way of life, and it works :)

    --- Msged/LNX 6.1.2 (Linux/5.7.6-gentoo-x86_64 (x86_64))
    * Origin: I will always keep a PC running CPM 3.0 (2:230/0)
  • From Sean Rima@2:263/1.1 to mark lewis on Sun Jun 28 23:21:42 2020

    Hello mark!

    28 Jun 20 14:56, you wrote to me:

    Re: Outbound Report
    By: Sean Rima to Benny Pedersen on Sun Jun 28 2020 15:25:56


    # is more or less commentary charter, so all after that should
    be ignored so it gives syntax fails since {} is not complete,
    hope i am wroung or learn more :)

    I believe the way the script is written it is search for # at the
    start of a line,

    it does...

    if is finds it, it is supposed to ignore it.

    it removes it in the var...

    I had to change it to the method I showed earlier as it was corrupting the var

    But bash changed and the method no longer works. Maybe now it
    seems it as a comment

    what version of bash are you using, sean? it works fine here on all my machines which vary from ubuntu 14.04 up to ubuntu 20.04...

    I am using 18.x on the fiodnet PC and 20.x on the laptop and both gave the same error

    scroll down about 2/3rds of this page:

    https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Exp ansion.html


    [quote]

    ${parameter#word}
    ${parameter##word}

    The word is expanded to produce a pattern and matched according to
    the rules described below (see Pattern Matching). If the pattern
    matches the beginning of the expanded value of parameter, then the
    result of the expansion is the expanded value of parameter with the shortest matching pattern (the ‘#’ case) or the longest matching pattern (the ‘##’ case) deleted. If parameter is ‘@’ or
    ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If
    parameter is an array variable subscripted with ‘@’ or ‘*’,
    the pattern removal operation is applied to each member of the array
    in turn, and the expansion is the resultant list.

    [/quote]


    Maybe it is something to do with the fact that I ssh into my PC's

    Sean


    --- GoldED+/OSX 1.1.5-b20180707
    * Origin: A Pointless Point in Connemara (2:263/1.1)
  • From mark lewis@1:3634/12 to Sean Rima on Mon Jun 29 10:18:48 2020
    Re: Outbound Report
    By: mark lewis to Sean Rima on Sun Jun 28 2020 21:33:51


    I am using 18.x on the fiodnet PC and 20.x on the laptop and both
    gave the same error

    interesting... i'll post you a little test script later... i'd like
    to see the output of it, please... i gotta write it first, though ;)

    ok, i think i figured out the problem... please try this script and post back the output...

    ----->8 snip 8<-----
    #!/bin/bash

    printf "\n"
    printf "%s\n" "$(bash --version | egrep -e 'bash')"
    printf "%s\n" "$(uname -a)"
    printf "\n"
    printf "test1 - replace \"^..\" with \"myNewPath\"\n" testvar="^../SomePath/aSubPath"
    printf "test1 input : \"%s\"\n" "$testvar"
    printf "test1 output: \"%s\"\n" "${testvar/'^..'/myNewPath}"
    printf "\n"
    printf "test2 - strip \"^\"\n"
    testvar="^/SomePath/aSubPath"
    printf "test2 input : \"%s\"\n" "$testvar"
    printf "test2 output: \"%s\"\n" "${testvar/'^'}"
    printf "\n"
    printf "test3 - strip \"-\"\n"
    testvar="-/SomePath/aSubPath"
    printf "test3 input : \"%s\"\n" "$testvar"
    printf "test3 output: \"%s\"\n" "${testvar/'-'}"
    printf "\n"
    printf "test4 - strip \"#\"\n"
    testvar="#/SomePath/aSubPath"
    printf "test4 input : \"%s\"\n" "$testvar"
    printf "test4 output: \"%s\"\n" "${testvar/'#'}"
    printf "\n"
    printf "test5 - strip \"@\"\n"
    testvar="@/SomePath/aSubPath"
    printf "test5 input : \"%s\"\n" "$testvar"
    printf "test5 output: \"%s\"\n" "${testvar/'@'}"
    printf "\n"
    printf "test6 - strip \"~\"\n"
    testvar="~/SomePath/aSubPath"
    printf "test6 input : \"%s\"\n" "$testvar"
    printf "test6 output: \"%s\"\n" "${testvar/'~'}"
    printf "\n"
    printf "test7 - strip \"!\"\n"
    testvar="!/SomePath/aSubPath"
    printf "test7 input : \"%s\"\n" "$testvar"
    printf "test7 output: \"%s\"\n" "${testvar/'!'}"
    printf "\n"

    ----->8 snip 8<-----

    thanks!


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)
  • From Sean Rima@2:263/1.1 to mark lewis on Wed Jul 1 23:35:02 2020

    Hello mark!

    01 Jul 20 13:36, you wrote to me:

    Re: Outbound Report
    By: Sean Rima to mark lewis on Mon Jun 29 2020 21:08:26

    -=-=-=-= MacBook =-=-=-=-
    test4 - strip "#"
    test4 input : "#/SomePath/aSubPath"
    test4 output: "/SomePath/aSubPath"
    test6 - strip "~"
    test6 input : "~/SomePath/aSubPath"
    test6 output: "/SomePath/aSubPath"

    =-=-=-=- Ubuntu -=-=-=-=
    test4 - strip "#"
    test4 input : "#/SomePath/aSubPath"
    test4 output: "/SomePath/aSubPath"
    test6 - strip "~"
    test6 input : "~/SomePath/aSubPath"
    test6 output: "/SomePath/aSubPath"

    excellent! my fix was tested i that script and we're good to go now...
    the trick, such as it is, is to use single quotes around at least
    those two problematic characters... my updated code in the repo single quotes all of them...

    I get a no term error when run from a cron script , but other than that, it is working well

    Sean


    --- GoldED+/OSX 1.1.5-b20180707
    * Origin: A Pointless Point in Connemara (2:263/1.1)
  • From mark lewis@1:3634/12 to Sean Rima on Wed Jul 1 19:23:52 2020
    Re: Outbound Report
    By: Sean Rima to mark lewis on Wed Jul 01 2020 23:35:02


    I get a no term error when run from a cron script,

    probably due to the use of redirection and tee...

    but other than that, it is working well

    i'm glad to hear that :)


    )\/(ark
    --- SBBSecho 3.11-Linux
    * Origin: SouthEast Star Mail HUB - SESTAR (1:3634/12)