« first day (2583 days earlier)      last day (1118 days later) » 

12:03 AM
Anyone around for a reviewing judgement call?
A posts was closed as unclear (the OP clearly intended to self-answer); they've improved the Question, but now I feel it's close-worthy as "off-topic, typo". Do I vote to reopen, then later VTC, or vote to leave closed (or skip), knowing that it'll remain closed for the "wrong" reason?
Q: 2GB of shared memory used as shown in free

IljaBekOS: Ubuntu 16.04 free output indicated about 2GB of shared memory. The shared memory was still allocated after a reboot, and no particular process from top list was occupying it. ipcs -m did not indicate any singular process (or sum) with this consumption. sync or sysctl vm.drop_caches={1..3} ...

Think I'll vote to leave closed + leave a comment.
12:40 AM
@EliahKagan Getting rid of the trickery with /dev/stdout that you suggested but I probably misinterpreted and therefore botched worked. I think I'm just going to run the script command raw, then run the Perl script on the resulting typescript.
@JeffSchaller Err, that's not close as a typo.
@JeffSchaller Close as a typo is for those questions where the question turned out to be silly because of a typo. E.g., wondering why catt /tmp/file doesn't work in the middle of a script.
This isn't — it seems to be caused by any random file in /tmp (which I'm guessing is a tmpfs, and I guess that shows as shared? Not sure.)
@JeffSchaller the general rule is, don't reopen just to close with a different reason. Duplicates are very occasionally a good reason to make an exception.
Just leave a comment.
OTOH, I have no clue how that still existed after reboot.
12:56 AM
@derobert because he tried his script with a typo again
I guess that'd do it.
@derobert I've seen milder "typo" questions closed, and while I generally don't mind leaving questions open if it's obvious that they didn't know what they're doing (for educational purposes), this was self-answered with "oops, I did the wrong thing", which put it into "close/typo" land for me.
It seems to me that it could be useful for future visitors with a little editing (lots of shared memory: check for files on a tmpfs(?) like /dev)
Right, what Gilles commented later -- there's no other solution than what the OP drops in, with no clue as to the origin in the Q.
@derobert "What are all the possible consumers of shared memory?" ? Seems possibly useful , but possibly broad
Sure, but it doesn't have to be that. Could just edit in something about it happening after trying to write to a block device with dd.
To be closed as a typo, IMO, it needs to both be a typo and be useless to future visitors. Accidentally adding a file to /dev seems easy enough to do by mistake that it could be useful to future visitors. With some editing, of course.
1:11 AM
@derobert I'm trying to get a feel for things here. So do you feel that a Closed version of that question is less useful than an Open one?
I think it'd be obvious from reading the Q, the self-answered "oops" A, and the closure text "went away when a typo was fixed" would make it clear what the situation was
Closed questions, e.g., don't show in search results, I believe, unless you explicitly ask for them. So they're not findable by anyone having the problem.
Also it's a negatively-scored closed question, so I think it'll be Roomba'd — and deleted questions definitely do not show in search results
Oh my. That would be something I didn't know
@derobert hmmm, this works:
I searched for a closed:yes question, then searched for unique-ish text in there, and came up with the closed Q in the results
I think the +4 answer must be saving it from the Roomba
the Roomba thing I don't get yet either -- so even if this has an Answer, the Q would get deleted if closed & negatively scored
off to Meta I go to search for the Roomba rules
@JeffSchaller If I'm remembering right, if all the scores are ≤ 0 and closed, then after some amount of time, it'll be deleted
(and if all <0, will be deleted even if open, I think)
1:18 AM
@derobert so maybe the one A up-vote could save it?
Probably. Must check the roomba rules to be sure
Q: How does deleting work? What can cause a post to be deleted, and what does that actually mean? What are the criteria for deletion?

jjnguyWhat circumstances can cause a question or answer to be deleted, and what does that actually mean? How can a post be deleted? When can't I delete my own post? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete wo...

seems to me like #7 might be the closest, the rest requiring it to be Unanswered; but this has an upvoted A
Yep. It previously didn't, then I guess both of us upvoted the A changing it from -1 to +1
and votes can change -- anyway, it's a good excuse for me to visit some more of the FAQ pages :)
@JeffSchaller yes, the roomba never deletes a positive-scoring answer
1:24 AM
It's the Q that would be Roomba'd, right?
@JeffSchaller yes, but deleting a question deletes its answers as well
Well, if a question is deleted, so go all the answers.
I see A's can be deleted after reviews
Yeah, answers can be deleted too (w/o deleting the question).
Deleted one of my own recently! There's one thing I know.
1:25 AM
answers are never deleted automatically as such, only in response to reviews, delete votes or flags
After reviews, by the owner, by a diamond mod, and (in some cases, I think) by 10k or 20k rep users directly from the answer page
answers are deleted if the question is deleted, but automatic deletion won't delete a question that has a positive-scoring answer
@derobert 3 delete votes from 20k users (more if the answer has upvotes, I don't know the formula)
so, have I convinced derobert that this particular Q would be OK if it was closed?
@Gilles yeah, but only sometimes... e.g., I think it has to have a minimum age. That answer, for example, doesn't show a delete link
it won't (currently) be Roomba'd, and should show up in the search results
1:28 AM
@derobert which answer?
There's no minimum age to vote to delete an answer
@Gilles unix.stackexchange.com/a/402373/977 only has share, edit, flag
after all, most crap answers are detected soon after they're posted
oh, I misremembered: for an answer, you can only vote to delete if its score is <0
so it isn't “more if the answer has upvotes”, it's always 3 delete votes, but the answer has to score <0
except from the review queue, maybe?
@derobert the rules are different, yes
I suppose it would have to be flagged, manually or (automatically?) to get into the queue.
I'm guessing there's a VLQ roomba flagger
1:40 AM
@EliahKagan: I'm still seeing control characters in my output, but either they're non-standard or I need to modify the regex in the Perl script in order to catch them (they can be used several times per any given line instead of just one per line, and I don't know if the Perl script is designed to handle that, though I hope it is…)
(FYI, what's left over looks like '^[[<number>m'.)
1:56 AM
I'll check back on this tomorrow.
4 hours later…
6:00 AM
@RandomDSdevel The Perl script should remove as many escape sequences as appear in a line, not just the first one, yes. The g at the end achieves this. Specifically, the script uses the syntax documented here (or run perldoc perlre if you have perldoc installed; or, on some systems, man perlre works).
The s/ the beginning means it performs substitution, then there's a regular expression that matches several cases (because it it composed of several shorter regular expressions separated by |, which means alternation), matches are replaced with the text between the opening and closing / characters in //, i.e., they are removed, and the xg at the end are modifiers.
The x modifier causes perl to ignore unescaped whitespace and # comments, thus permitting them to be used to make the regex readable. The g modifier causes perl to substitute for all matches on each line, rather than just the first match on each line.
4 hours later…
9:51 AM
@EliahKagan This sort of thing looks like it should be an answer. Instead of having technical discussions here, have whoever is asking to post a question.
@FaheemMitha They do have a question. I suppose it might turn out to be a duplicate of--or to have an answer written in terms of--the other answer that I was talking about.
Their question references a number of other questions and describes very weird behavior happening with a command whose operation is very complicated (because it causes a program and all its dependencies to be downloaded, compiled, and installed, with numerous processes presumably writing output).
It has been gradually revised based on the discussion here. I would definitely post an answer to it if I could; the main reason I haven't posted an answer suggesting that Gilles's script would work--or flagged the question for closure as a duplicate--is that the other question that contained it was listed among what the OP already tried.
They've also seemed not quite to have gotten it working, though, and I have no idea why that is happening.
Anyway this is RandomDSdevel's question on the site (sorry, I should've led with this link, it would have made everything else I said make way more sense):
Q: How Do I Unbuffer The Output Passed From an Interactive Command Into a Pipeline Ending With `tee`?

RandomDSdevel     I'm troubleshooting an interactive command and would like to: see output printed to my screen with its original coloration, unbuffered or line-buffered (instead of block-buffered,) as that command produces it use something like tee to redirect this command's output to a file at the same ...

@EliahKagan Just to be clear, has their question been posted on the site?
Oh, sorry. I see the answer is yes.
@EliahKagan Looks messy.
Though relatively literate for a low rep user. Not that that means much in theory, but in practice it often means cluelessness.
I can't explain the cause of the problems, but I think this or a manageable modification of it should work to strip out the escape sequences from a logfile produced by the script command, and then the command will still have been outputting to a terminal, its standard output will remain line-buffered:
A: Removing control chars (including console codes / colours) from script output

GillesThe following script should filter out all ANSI/VT100/xterm control sequences for (based on ctlseqs). Minimally tested, please report any under- or over-match. #!/usr/bin/env perl ## uncolor — remove terminal escape sequences such as color changes while (<>) { s/ \e[ #%()*+\-.\/]. | (...

10:04 AM
Bottom line - he's having problems using his method with a specific command.
I don't know why ^[[Nm sequences (where N is a digit) are still left over in the processed file.
@FaheemMitha I think with brew commands that run builds in general, but yes.
Though the question isn't specifically about that script of Gilles's. I just think that (or perhaps a derivative) is likely to be the solution.
@EliahKagan So, clean up the output so that the poster's approach will work?
I'm not sure what processing is needed. Maybe something is already turning the escape sequences into their representations (with actual ^, [, [ characters)? It could actually be just some of them. Any of what I believe are numerous separate processes that write to standard output and standard error during the course of the build could behave differently based on what they think they're outputting to (or just in general, if there's a bug).
@RandomDSdevel Can you actually provide a full output file that still has those sequences in it? I would take a look at it. You could also update your question with it (or a link to it--I imagine it's quite long).
@EliahKagan Shell stuff always seems to be messy. That's part of why I try to avoid it.
10:12 AM
And I think often people use shell when Python or even Perl would be preferable.
And of course there are many other languages one can write scripts in.
I wonder what language brew is written in.
Well there isn't really an alternative here, I don't think. I mean, this is not really shell-specific, even. The escape sequences are for terminals but apply to any program. The brew script is not written by the user who is asking the question.
@FaheemMitha Tcl, I believe.
@EliahKagan oh.
@EliahKagan Fair enough.
But it calls configure scripts that are probably for /bin/sh, as well as make, and probably lots of other stuff that produces output. Depending on the verbosity, direct output from tools like clang or gcc may be included.
@FaheemMitha I am apparently mistaken. According to Wikipedia‌​, brew is implemented in Ruby.
Huh. I remember using a community-maintained package manager on macOS some years ago where the recipes ("formulae") were Tcl scripts. But they're Ruby too, with Homebrew.
Sorry about the wrong information!
10:51 AM
@EliahKagan No problem.
11:32 AM
@Kusalananda Hi, available?
@HaukeLaging Hi there! Yes.
@Kusalananda I noticed that is says "Sweden" in your profile. Are you currently living there?
@HaukeLaging I am, yes.
@HaukeLaging Why?
@Kusalananda Sweden is "missing on my map yet" as I haven't found anyone suitable there yet. In 2015 the Berlin LUG has started an event series which I have developed and which has spread to more than 100 cities in Germany and several other countries in the meantime: linux-presentation-day.org
It is the "simple" task of finding one suitable person per country. Unfortunately in most countries that hasn't worked out yet. ;-)
A while ago I tried to find someone for Greece here in the chat. That was somehow successful so I thought I give it a try with you.
On the positive path you might either be interested in that idea yourself or know suitable people in Sweden.
I met up with some UK Debian devs at a pub once when I was living over there, but I haven't seen any Linux meetings over here.
I'm an OpenBSD user though... :-)
11:44 AM
The LPD has taken place in three cities in the UK. But there is nobody to do the organising on the national level. I am quite disappointed: I subscribed to about 100 UK LUG and hackerspace mailing lists. I expected more than just three results.
We accept OpenBSD users, too... But OpenBSD is obviously nothing you would present to the LPD audience.
Not every Linux enthusiast is an organizer with free time.
Due to a job change I do not have much time for this any more and thus have stopped contacting new countries. This is rather a coincidence.
(sorry, slow typing today, bloody qwerty keyboard)
@Kusalananda That is very true. Unfortunately there is no public list of those with free time so it's a game of chance every time again. But ONE IN A THOUSAND Linux users would be enough. That is the sad truth.
However, should you happen to meet people in Sweden (who need not be Linux experts) who seem suitable for this to you (attitude, free time) then feel free to point them at the web site (or me at them).
And I'm kinda bound up with other things and I don't know who else would be a good candidate.
I will do.
11:50 AM
@Kusalananda OK, bye
@HaukeLaging If I had a proper keyboard, I would chat more...
12:16 PM
@Kusalananda You're keyboard-handicapped today? :-)
12:34 PM
@FaheemMitha New laptop, silly qwerty layout... Awaiting new Dvorak key stickers to be delivered next week.
It not just that it's qwerty, it's Swedish as well. Double pain.
1:04 PM
@Kusalananda there are swedish dvorak keyboards?
@sebasth There's actually something called "Sworak" (or something similar) :-)
I'm used to the US Dvorak layout though.
Svorak, apparently. Not Sworak.
I do understand the pain of the standard swedish layout
I occasionally have been thinking of learning another keyboard layout, but the whole experience just feels a bit painful. I am still hugely annoyed by the new (6 row) ThinkPad keyboards. Should just get an old ThinkPad with actually decent keyboard.
1:21 PM
@Kusalananda What laptop model?
1:57 PM
@FaheemMitha Refurbished Lenovo Thinkpad x230
Nice, I had an x230 too until the main board on it fried. Now I think I'll get a refurbished x220; I value the nicer keyboard more than having a bit newer hardware
@sebasth The particular place I bought this one from didn't have any x220's
There is also this, from experience I can say it is not as simple as the page claims
@sebasth I have no issues with the actual keys, I just need to relabel them...
(I suspect SWE layout keyboard not wired the same way as the one which was used in the article, after modifying wiring the trackpoint mouse buttons do not work anymore)
I definitely do not like how the new keyboard Application Menu Key was replaced by Print Screen button. Also prefer the old/traditional 7 row navigation key (insert, home, page up, ...) layout.
2:56 PM
@Kusalananda Is refurbished a good choice?
Are they sturdy laptops?
The old IBM Thinkpads were built like tanks.
@FaheemMitha yes, even the recent ones, although the last really sturdy ones where the x20 series (e.g. the T420)
the only ones to avoid are the x40 series because their touchpad is awful
@StephenKitt Do you have one of those?
@FaheemMitha I have a T420 and a T450s
@StephenKitt Oh. Is more than one necessary?
I've got an ancient laptop. I've thought of buying another one, but don't really need it.
@FaheemMitha well strictly speaking I have a T450s and my wife has a T420
3:09 PM
It might occasionally be necessary.
(both are work laptops)
@StephenKitt Oh, I see.
Is Lenovo keeping up with the old IBM standards?
@FaheemMitha to a large extent yes, at least on the T/W/X series
(depending on what you think of chiclet keyboards)
@StephenKitt The ancient laptop in question is a Lenovo T60.
I'll consider another Lenovo at some point. I don't use laptops much but I suppose that might change.
@FaheemMitha ah yes the T60 was very good
3:16 PM
I have no opinion about chiclet keyboards. I suspect I have had no experience with one.
@StephenKitt Though now sadly defunct.
Mine still works, though the battery died long ago.
And I didn't get one while it was still available. I suspect it's now too late.
Lots of third party ones of questionable quality.
@FaheemMitha yeah you’d be better off finding someone who knows how to rebuild batteries, and rebuild your battery with new cells
@StephenKitt Interesting notion. I'd not thought of that.
And in India, that might actually be a practical option. Though finding such a person might be difficult. Would finding new cells be easier than finding a new battery?
@FaheemMitha yes, and at least that way you know the cells are new (“new” batteries are often new-old-stock which don’t last long)
@StephenKitt Yes, I bought one supposedly new third party replacement for the T60 battery which was junk.
Any idea where I could get such cells from? Do Lenovo themselves sell them?
Surprisingly, I found some listings on Indiamart - dir.indiamart.com/impcat/laptop-battery-repair.html
There are a few Bombay ones.
Looks like 2, actually.
3:35 PM
@FaheemMitha no, you just get them from cell manufacturers; people who rebuild batteries know where to get them
Called one of them - he said they don't do battery repair any more.
I can't imagine it's a lucrative business. I could contact the people who did some computer work for me - they are mostly a laptop shop, I think.
I think laptops are far more common these days than workstations/desktops, at least in India.
That gentleman suggested I contact Lenovo directly. I doubt that would be useful but I could try.
@FaheemMitha I suppose you could
3 hours later…
6:54 PM
@EliahKagan: Either shortly after I got off last night or some time early this morning, I realized that the fact that running the Perl script printed a bunch of stuff to standard output probably just means that the version of my log file stripped of escape sequences didn't overwrite said file's original contents.
@EliahKagan Give me a little while; I usually go through a list of other software that I check for updates to first thing when I boot to my external drive every day, but I'll get you that part of what I plan to push to a GitLab repo once I get through to not having anything else but the flaky build to run in Homebrew.
Continues perusing his transcript backlog…
@RandomDSdevel Ok, sounds good.
7:10 PM
Before I get too busy again, I noticed that some people were talking about how they missed the old 7-row Thinkpad keyboards (I use Macs at home, but we had IBM Thinkpads running Windows at school for a while when I was still in elementary and middle school, though we got some HPs after that before they started phasing in just giving everybody dinky netbooks.) …
…Anyway, I recall seeing in passing mentioned on one of the tech news sites I frequent that Lenovo is releasing (or maybe already has) a new throwback ThinkPad with the old 7-row layout for its keyboard.
Now, down to business…
@RandomDSdevel I understand you may not be able to answer this now, which is no problem, and I also wonder if I've asked this before but forgot, though if I would've asked it, it would have been somewhere around there. ...Once this log file is written, and you open it to see actual colors (as you described much earlier), or text representing escape sequences as you've recently reported...how are you opening and examining the file?
@EliahKagan With nano.
According to output left over and save using macOS's 'Resume' (I have it turned off by default, but often use 'Quit and Keep Windows' for specific applications) from my last Terminal.app bash session, my earlier suspicions with respect to the Perl script were correct: its output got to standard output but just didn't make it back into the log file I was having it strip ANSI escape sequences from.
So I just have to invoke it with a shell redirect or change the print statement in the Perl script.
Though I'm not sure how exactly overwriting would work since the output with escape sequences stripped would be shorter than the input without, which could leave stuff not overwritten at the end of it since I'm writing back to the same file.
Does overwriting redirection clear a file of its contents before writing to it? I can't recall whether it does or not from off the top of my head. Ah, well, something to look into after I get the unprocessed log file to you.
7:39 PM
@RandomDSdevel If you use output redirection with > (not >>), then the file's contents are erased upon opening.
How are you writing to the log file before processing it with the Perl script, and how are you processing it with the Perl script? I mean, can you give the specific commands?
@EliahKagan Thanks.
@EliahKagan Hold on, I have it typed in manually at the top of the log…
(Still updating other things, so you'll have to wait to see what you asked for until I can at least get that going; I'm to other Homebrew stuff now.)
Also, is nano what had shown colors before? If so, were they actually the same colors on the same text as had been shown on the terminal? At least some versions of nano support syntax highlighting.
I imagine that the version in macOS--if you're using what came with the system--would be older than what I use, because I think the newer versions are licensed GPLv3, which Apple doesn't like. So I don't know if you're going to get syntax highlighting and, if it does support it, then I don't know if you'll get it automatically as I do for many file types on Ubuntu.
@RandomDSdevel No problem.
@EliahKagan No. Remember that it turned out that I was mistaken about nano showing colors. They show up at run-time when running the logged command in the terminal just fine, but nano just shows the escape sequences raw. I don't have syntax highlighting set up for nano yet.
Oh, okay.
7:54 PM
@EliahKagan I use the latest version of nano from Homebrew (my "$PATH" is set accordingly.)
So, let me get you that command sequence…
@EliahKagan You're welcome.
I am wondering if you ran script, then while script was still running and writing to its typescript, attempted to process the typescript with Gilles's Perl script that removes escape sequences. That would not be likely to work, because script could write more data to the file at any time during the process, and eventually would do so. Older data containing escape sequences might be buffered but not written, etc.
Basically, if you're using a method that involves two or more commands that are running at the same time separately opening the file for write access, then I would suspect that's the cause of your remaining problems and, even if not, I'd recommend against it.
Typing it into chat now (I'd just copy and paste, but I have soft line-wrapping and line numbers set up in nano for display, and copying gets the displayed line breaks and the extra space from the line numbers, and nano's clipboard doesn't interface with OS X's, as far as I know.)
Oh well you can save yourself some effort.
Just display it with another method that doesn't give you that stuff.
7:57 PM
Eh, I can just copy line by line.
Okay, if you prefer.
(Or I could relaunch nano with options to override my .nanorc, but I won't bother right now, as I'd have to look them up.)
Or install pastebinit (though maybe you cannot do so now because you are running brew for something else) and you could use that.
@RandomDSdevel Well if you do want to show the top however many lines of a file, you can just do that with the head command, and then you can copy the output from Terminal.app.
Oh, cool! Then I can just pipe that to pbcopy.
Yes. Or probably manually selecting and pressing Command+C in Terminal.app would work too, for copying small amounts of text efficiently.
You can run head -n N where N is replaced with a number to specify how many leading lines you want, if the default of 10 is unsuitable.
8:02 PM
Yeah, I decided to quit nano to look at the man page instead of holding off until later for that for whatever command I needed help with. Could have opened another tab in Terminal, now that I think about it, but I'll just give you that first handful of lines now.
OK, here it is: first I ran HOMEBREW_BUILD_FROM_SOURCE=1 script -akq /Volumes/Development/Repositories/Homebrew\ Build\ and\ Installation\ Logs/Mailutils/v3.4/Recorded\ Attempts/First\ Recorded\ Attempt/With\ `HOMEBREW_BUILD_FROM_SOURCE\=1`/upgrade.out brew upgrade -vd --build-from-source mailutils.
Then I did ~/Documents/Development/tmp/rm_ANSI_ctrl_seqs.pl /Volumes/Development/Repositories/Homebrew\ Build\ and\ Installation\ Logs/Mailutils/v3.4/Recorded\ Attempts/First\ Recorded\ Attempt/With\ `HOMEBREW_BUILD_FROM_SOURCE\=1`/upgrade.out, where ~/Documents/Development/tmp/rm_ANSI_ctrl_seqs.pl is a slightly modified/reformatted local copy of unix.stackexchange.com/a/18979/86927 (the updated version of Gilles's Perl script.)
(Sorry, Wi-Fi hiccup.)
I'm not sure what's part of your commands and what might be accidental backticks. For that reason, and also to make it generally easier to read, can you format the commands as code blocks by posting them as the sole content of a message and indenting them by four spaces? If you paste both commands on separate lines into a single message with no other text, a "fixed font" button will appear to the right of "send" and "upload..." and clicking it will perform that indentation automatically.
OK, will do.
HOMEBREW_BUILD_FROM_SOURCE=1 script -akq /Volumes/Development/Repositories/Homebrew\ Build\ and\ Installation\ Logs/Mailutils/v3.4/Recorded\ Attempts/First\ Recorded\ Attempt/With\ \`HOMEBREW_BUILD_FROM_SOURCE\=1\`/upgrade.out brew upgrade -vd --build-from-source mailutils
~/Documents/Development/tmp/rm_ANSI_ctrl_seqs.pl /Volumes/Development/Repositories/Homebrew\ Build\ and\ Installation\ Logs/Mailutils/v3.4/Recorded\ Attempts/First\ Recorded\ Attempt/With\ \`HOMEBREW_BUILD_FROM_SOURCE\=1\`/upgrade.out
Is the second command running while script is still running?
Or, wait. You're not using script interactively, are you?
8:12 PM
@EliahKagan No, I wasn't able to figure out how you said I could pipe them together, so I just ran them sequentially, hence my comments earlier here and here.
@EliahKagan That's correct.
You're passing script the -a option. Do you need to keep the output of all the previous runs?
No, I clear it manually; that's just to keep my comment at the top of the file.
(So that when I submit it as part of my issue report to Homebrew, people reading it will know what commands generated it.)
Have you tried running script for this without the -k option? Do you need your input logged?
I wonder if that would make a difference to what is being shown. Maybe some of the escape sequences that have been retained are due to your input rather than the output.
No to the former, and I suspect 'no' to the latter, as well: all I type is the number 1, then Return, to select raise (a Ruby exception and abort the build) when Homebrew asks how you want it to respond to the make failure within Mailutils's build script.
I know you don't yet have a way to provide the full output, but can you give a few examples (distinct, assuming there are distinct sequences) of the text that is appearing in the output of the Perl script, that the Perl script seems like it ought to be able to remove?
And you're using dewtell's script, right? Did you try Gilles's original script, too?
8:25 PM
@EliahKagan Yes to the former and no to the latter, but, given what I've seen in the script's standard output, it does work; I just haven't gotten around to getting this output into the log to overwrite it's previous contents yet.
@EliahKagan Hold on, I'll just pause what I'm doing right now and get you the unprocessed version really quickly. Do you want it as a GitHub Gist, on Pastebin, or somewhere else (I think the second option would be quickest, but you can pick.)
Any of the above is definitely fine.
(Oh, wait, never mind; I could use GitHub's web interface for a Gist. I've messed with the resulting repositories locally before, which is why I forgot about that for a moment.)
@EliahKagan I'll just give a quick Pastebin, then. Hold on a sec…
However, is this the output of the Perl script that you are showing me, or the contents of the unprocessed file on disk? I had not realized until just then that not having written the output to a file might actually be the only remaining problem. Is it possible that you do actually have a fully working solution already?
@EliahKagan The latter, and that's what I've been trying to say for a little bit now. I may post it as an answer to my own question soon.
I apologize for my confusion. I thought that you had attempted to write it to a file and that there were escape sequences in that file.
@RandomDSdevel Yes, please do. I expect it may help others with similar situations where they are running a command that produces lots of output, need to see the output right as it's produced, and need to effectively remove escape sequences from it for logging purposes.
8:32 PM
@EliahKagan No, I haven't done that for the script output yet.
Here's the file before processing.
@EliahKagan Of course.
@RandomDSdevel Thanks.
You're welcome.
Now, back to non-Mailutils Homebrew updates for a bit…
8:50 PM
Btw I've run dewtell's script on the file, and it does appear to work, at least when run on my Ubuntu 16.04 system. No escape sequences seem to remain. Specifically, the actually control character (represented variously as ^[ or \e) is not present in the output (I grepped for them), nor are any bits that appear to have been part of an escape sequence--specifically, any digit followed by an m--present (I grepped for them too), nor anything odd-looking when viewed in vim and nano.
@EliahKagan Yay! I'll do that after I get to Mailutils, then. I may regenerate that log since I've updated brew and its taps since then, though. I know what to do now, anyhow.
(Logs for issue reports are supposed to be generated by the most recent brew release, plus latest tap commits.)
(To check to make sure that something hasn't fixed the bug you're trying to document. I doubt it has, though, since they'd require this to be fixed upstream first.)
2 hours later…
10:46 PM
@EliahKagan: For some reason, running "$LOCATION_OF_PERL_SCRIPT" "$LOG_FILE" > "$LOG_FILE" results in…an empty log file?!? I regenerated it, but I'm going to need to change redirection strategies instead of running that and nuking things again. To the docs!
No mention of that effect in man bash. To Google!
11:14 PM
@RandomDSdevel Correct. The shell establishes redirections before running the command. For the output redirection, the file "$LOG_FILE" is opened for write. You are using > and opening a regular file, so existing data in the file are erased when the file is opened. This is before the Perl interpreter even runs. Then the script is executed. This problems will always happen and is not specific to whether the command is a shell builtin or a binary or text executable or how it reads the file...
...but the details may make the situation conceptually clearer, so: When it gets to the <> in its code, perl examines the command-line arguments and sees that it is being asked to open "$LOG_FILE" for read, so it does so. But the file has already been emptied out! The input is empty, so there are no lines to process, so no output is produced.
I recommend you simply output to a different file. Really you probably want that anyway, so if it doesn't work properly then you can compare the two files, and in case you have use for the original, and in case the script cannot complete for some reason or you need to check if a different method produces the same output.
However, you do also have the option of running the script by passing its name to perl -i.orig, where .orig is whatever suffix you like, or you can even omit the suffix and just use perl -i, though I don't usually recommend this. If you do use a suffix, you get a backup file and this is just as good as my recommendation to just send the output to a different file.
The -i option makes <> do "in-place editing," which creates a new file and automatically renames (if you supply a suffix) or causes to be removed (if you don't) the original file. For details, run perldoc perlrun or man perlrun or read this page. If you use perl -i or perl -i.orig, then you don't need to redirect the output, and you shouldn't, as perl write the output file itself.
OK. I also found unix.stackexchange.com/a/186126/86927, so I was thinking about using one of the methods described there.
11:35 PM
I ended up using sponge from GNU moreutils in a pipeline; it worked.

« first day (2583 days earlier)      last day (1118 days later) »