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?
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?
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#?}
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
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
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
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. :)
name=${name#?}
I haven't checked yet but I am assuming lines 308 and other will also need changing
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...
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...
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]
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 ;)
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
Sysop: | Coz |
---|---|
Location: | Anoka, MN |
Users: | 2 |
Nodes: | 4 (0 / 4) |
Uptime: | 80:51:54 |
Calls: | 295 |
Files: | 5,633 |
Messages: | 226,073 |