« first day (2754 days earlier)      last day (2192 days later) » 
02:00 - 20:0020:00 - 21:00

2:51 AM
After a conversation with @JeffSchaller I did my best to improve my following question which was heavily downvoted. I ask from those who downvoted to consider this step:
-2
Q: Are if-fi statements necessary before a simple pushd list?

user9303970I use the following code which is part of this script that uses me to update my WordPress websites: #!/bin/bash drt="/var/www/html" for dir in ${drt}/*/; do if pushd "$dir"; then command1 command2 popd fi done Background I learned of the specific pushd-popd pattern...

 
 
4 hours later…
6:39 AM
Not sure if I should edit out the parts about depression or flag for mod attention:
1
Q: Creating a tarball from named pipes using tar or python's tarfile module

user287582I didn't realize this would be so difficult. I'm just using tar. I have two pieces of data, one's a large payload of pcap data, the other is some additional metadata in the form of a python pickled file. My goal goal is to create a .tar file containing both files, and compress with with XZ. I wa...

 
 
1 hour later…
7:54 AM
0
Q: Is it possible to install installer on laptop disk in order to install Linux to USB? How?

MunucialSo usually when we want a portable USB we'll prepare two USB sticks, one for the installer, one for where you install Linux. But now, I want to install solus but only got a 128GB USB which is used to install the Linux on it. So now I'm wondering, is it possible to split about 16GB from local dis...

Installing the installer on disk to be able to install linux on USB key,
I'm pretty sure there's an eaisier way this solution sounds so wrong that it must be an other way
 
8:20 AM
@muru It's been flagged. And now I find myself wondering the exact same thing :/
 
:(
 
 
4 hours later…
11:59 AM
@Kusalananda OPs can't delete their questions if they have accepted an answer.
There's also no reason to delete though.
Ah, never mind, you left the comment before the answer was posted.
 
@terdon Yeah. All that. I don't mind whatever you do there.
 
12:16 PM
@terdon in this case is it OK to point the user toward a better resources outside Stzackexchange : unix.stackexchange.com/q/439706/53092
 
@cuonglm You mentioned using '-v val=' in awk has code injection issues, would you please explain more how and if there is a link I can read? thank you
 
@Kiwy Why not? When is it not OK?
 
I don't if it's OK to point user to external resources if it's in the way of mind of stackechange in general
 
@Kiwy you can’t write an answer consisting solely of a link (unless the OP is asking for a link, e.g. to some project), but pointing readers to external resources is fine
 
You're free to post whatever you like! We have neither the right, nor the ability to force users to stay here!
 
12:19 PM
we do it all the time, e.g. to documentation, POSIX, source code etc.
 
Yes I know but in this case I cleary say to the OP to ask it's question someplace else outside stackexchange scope
 
I see absolutely nothing wrong.
 
OK cool
I'm proud I used the ping @terdon
 
@Kiwy ah now that’s wrong, you never apologise for pinging @terdon :-P
 
Oy!
 
12:24 PM
@Kiwy much better
 
grrrrrr
 
It’s hard to follow a conversation when comments are radically edited, but when done well it’s an endless source of fun!
 
where's that ?
 
12:47 PM
@αғsнιη I believe this is related: unix.stackexchange.com/a/56141/116858
Basically, awk does C escape sequence processing on values passed via -v.
... and this may be unwanted.
 
unix.stackexchange.com/q/439720/53092 Could someone rephrase my comment in the understandable way ? I feel so dumb in those situation where I could help but the OP shows a propensity not to answer a simple question
I'm going to be sarcastic and potentially when sarcastic I can sound a lot meaner than I'd like to
 
@Kiwy Don't be sarcastic. There's no point in possibly aggravating people.
 
@Kusalananda I like sarcasms but I know it's rarely the good approach ;D
 
@Kiwy It's probably better to avoid sarcasm. Polite and "professional" is probably the best way to go. It's bad enough that online it's easy to sound sarcastic even when not meaning to.
Of course, some people can be very provoking.
 
1:08 PM
@FaheemMitha I know, I don't understand though why it's easier to read sarcasm where there's none in emails or forums
 
@Kiwy I don't follow you there.
 
you said: "it's easy to sound sarcastic even when not meaning to."
 
@Kiwy It's the lack of tone of voice. One reads in a tone of voice that is not there, and misinterprets the intention.
 
I know I should not be sarcastic on purpose, but I'm also wondering why it's so easy to sound sarcastic online while not wanting to do so
 
@Kiwy Yes, it is.
@Kiwy Oh, I see. @Kusalananda addressed that.
In other words, what @Kusalananda said.
 
1:11 PM
@Kusalananda I wondered if anyone has done study on that matter I would be curious to read the result of serious study on this problem. The fact that the tone is not present is indeed a great lose of meaning
 
@Kiwy Hmm, that doesn't sound like something that would be the subject of study.
 
@Kiwy ... and facial expression and everything else that gives a statement or text in general context.
 
But of course, who knows.
 
@FaheemMitha I'd be surprised if it hasne't been addressed somewhere.
 
The fact is that electronic communication is a very low bandwidth method of communication between humans. A lot of information gets lost.
 
1:12 PM
@FaheemMitha I'm pretty sure there's psycologists and cognitician working on those stuff
 
@Kusalananda Addressed somewhere, sure. But serious study?
@Kiwy Not sure what stuff you mean.
 
Communications issues implied by electronical communication
 
@FaheemMitha There are studies on cultural differences giving rise to miscommunication in spoken languages (for example), so why not in written communication?
 
@Kusalananda Fair point.
I suppose anything can be studied as long as there is money available for it. And even fi there isn't. Karl Marx, for example.
 
2:08 PM
To be clear, I meant Karl Marx studied stuff, even though he was not being paid, as far as I know. And published it.
 
 
2 hours later…
4:37 PM
Hi folks. Anyone around to (potentially) help me debug a backup script?
A Borg Backup script, just to clarify.
 
@FaheemMitha I could let my eyes graze it for a moment...
 
@Kusalananda Wow, a full moment?
 
I'm around, though intermittently afk, and also I don't know anything about Borg except what I read between when you posted your message and when I posted this one. :) I'm interested though...
 
@FaheemMitha If it's interesting enough ;-)
 
Thanks, @EliahKagan. Actually, it seems to end up being a shell script debugging issue, usually.
 
4:39 PM
(only joking, just let me have a look)
 
Yeah, I'm definitely willing to take a look and see what I can figure out.
 
@FaheemMitha You have a pastebin link or something?
 
So, just to give the background here (in case anyone is interested) I've had local Borg Backup scripts running for a while. And I've even had to restore from backups occasionally because of my experiments with Mercurial.
@Kusalananda I don't actually have anything to debug at the moment.
Anyway, let me continue...
 
... 'twas a dark and stormy night.
 
However, some months or maybe years ago (I forget), I tried setting up remote backups for Borg, but it didn't gel properly, for whatever reason. And because I'm a wuss, I dropped it. Also, I was doing other things...
 
4:42 PM
... and the brigands sat alone in a mountain cabin
and the captain ordered Antonio to tell a tale
and this is how it began ...
 
But recent events have made me feel that I should try to get by backups in order. So I'm going to try and spend a little time right now to figure it out.
Possibly with the aid of you fine gentlefolk.
To be clear, figure out the remote backup thing.
 
@Kusalananda ... the data came in torrents — except at occasional intervals, when it was checked by a sudden outage of power…
 
@FaheemMitha it’s pretty easy IIRC
set up SSH access
set up the remote attic
 
@FaheemMitha doesn't sound too difficult.
 
Fortunately, I don't have torrential amounts of data.
@StephenKitt, @Kusalananda It isn't. But, like I said, I'm a wuss.
 
4:44 PM
then borg create ... attic@host:repository.attic::whatever
 
@StephenKitt I don't think borg called it an attic.
That would be... attic. Probably.
 
@FaheemMitha "careful" is the word, not "a wuss".
 
@FaheemMitha yeah this is carried over from attic
 
@StephenKitt Oh, is it? Ok.
 
I set up attic then migrated to borg
 
4:45 PM
Anyway, I'm going to set up some testing data first.
 
without changing the repo names
 
@StephenKitt Oh, I didn't know you used Borg too. You didn't mention it.
But right now, I'm going to go walkabout from my computer. See you guys in a bit.
 
@derobert ... only the creaking of the floorboards in the attic was heard between the thunderclaps, and the rain. It was the Borg.
 
:-P
Will @FaheemMitha be assimilated?
 
5:00 PM
BTW: I've had to rename some files in /etc/fonts/conf.avil on two machines now — is it just me, or should I be reporting a bug somewhere?
root@Zia:/etc# git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    fonts/conf.avail/65-0-fonts-beng-extra.conf/65-0-fonts-beng-extra.conf -> fonts/conf.avail/65-0-fonts-beng-extra.conf
        renamed:    fonts/conf.avail/65-0-fonts-deva-extra.conf/65-0-fonts-deva-extra.conf -> fonts/conf.avail/65-0-fonts-deva-extra.conf
        renamed:    fonts/conf.avail/65-0-fonts-gujr-extra.conf/65-0-fonts-gujr-extra.conf -> fonts/conf.avail/65-0-fonts-gujr-extra.conf
 
@derobert yes, that’s a common mistake
(yes as in, please report a bug)
 
Hmm... ok, that's embarrassing... bugs.debian.org/cgi-bin/bugreport.cgi?bug=854165
So appears I already reported it :-/
 
@derobert well, followed up on it
the upgrade handling is going to be interesting
 
I think it's been attempted, and failed. There were a bunch of .dpkg-new files as well, so I'm guessing dpkg didn't handle the mess.
 
@derobert I've already been assimilated. As you know, resistance is futile.
 
5:04 PM
@derobert exactly, it can handle it but it needs to be told how to
 
I noticed when fontconfig started spewing the can't read config files (a useless error I complained about earlier)
which eventually I tracked down using strace
Apr 21 at 10:23, by derobert
fc-cache -s
Fontconfig error: failed reading config file
Fontconfig error: failed reading config file
Fontconfig error: failed reading config file
Fontconfig error: failed reading config file
Fontconfig error: failed reading config file
 
@StephenKitt So, since you actually use Borg (though I didn't know) I have a question.
When you do a remote backup, do you add on the fly checks? Because this greatly adds to script complexity as well as runtime.
Or do you add occasional checks?
I don't know of an obvious way to tell a shell script - hey dude, only run this bit of code once in n times.
 
@FaheemMitha $RANDOM
 
@derobert For a fixed n.
 
$((RANDOM%5)) # may be slightly biased, but whatever
 
5:10 PM
@derobert Um. That's a random number mod 5?
 
Yep. So compare it to 0, and you've got ⅕ of the time.
Or if you need something deterministic, day of year works.
 
Hmm, just got 3 upvotes to my "Cron vs systemd timers" question.
Probably because it was edited.
 
Or if that's too biased, Julian day.
(though you'd have to use something other than date to get that, AFAIK)
 
@FaheemMitha occasional restore checks
that’s the big thing I’m missing compared to my old Bacula setup
but I’ve got to go, have a good night/evening/day/etc.
 
@StephenKitt Uh, are you saying you make occasional restore checks, or you don't?
 
5:13 PM
@FaheemMitha I make occasional restore checks
my Bacula setup had full verifies
 
@StephenKitt Oh, how occasional? And what's the big thing you are missing?
And is it an automated cron thing or not? The occasional restore checks?
 
5:32 PM
So, if there is anyone here, I have a simple shell script type question.
(He said, peering into the void.)
This is my current backup script. But only the first part completes. I was trying to find an old copy of my cron output, but I seem to have deleted all of them. Which is quite impressive, considering I do it manually.
To be specific, the backup INBOX bit doesn't run.
However, if I remove all the checks stuff and only leave the borg create stuff, it does.
I tested that just now.
I think I knew the reason why, but have now forgotten.
Did everyone leave? Dammit!
I forget how this works, but when you edit a shell script that is running, it has no effect on the actual running version, right?
I assume the running shell script version has already been loaded into memory...
 
5:50 PM
Hi, I'm back.
I'm not sure what's wrong with the script.
@FaheemMitha It may have an effect.
$ cat selfmod
#!/bin/bash
echo 'echo hello world' >>"$0"
$ ./selfmod
hello world
$ ./selfmod
hello world
hello world
$ ./selfmod
hello world
hello world
hello world
$
 
@FaheemMitha Shell reads commands from the script as they are executed, so editing it definitely matters.
(Unless your editor does an unlink/replace, instead of actually writing to the script, of course)
 
@derobert Oh, it does? My mistake.
@EliahKagan I'm running it now, to try to refresh my memory.
But actually I'd be better off setting up some test archives, which would run faster.
 
6:14 PM
Hey all! Does anyone here have experience with amazon?
 
@Hans What kind of experience?
 
Like using the Amazon MWS
Is that a new client wants to retrieve al products from a Amazon competitor by submitting the link in the tool I will be creating with c#
 
@Hans MWS?
Is this Unix/Linux related?
 
@FaheemMitha Ive never worked with Amazon tecnologies before so investigating I came across woth the Amazon Marketplace Web Service
no, is this a Unix/Linux page?
Ups sorry I didnt see that
Im Sorry
 
@Hans This is the main chat room for the Unix & Linux Stack Exchange site.
Well, general chat room, anyway.
 
6:20 PM
@FaheemMitha Sorry, didnt notice that
 
No problem.
 
I'm sorry to just barge in here, but might anyone know if shared mappings created with mmap ensure synchronous access between processes? I imagine it should, right?
 
Eek, I just did:
root@faheem:/mnt# chown -R faheem:faheem .
 
@Micrified What's mmap?
Now I'm getting:
root@faheem:/mnt# ls -lah
total 28K
drwxr-xr-x  7 root   root   4.0K Apr 24 20:14 .
drwxr-xr-x 22 root      500 4.0K Mar 11 18:10 ..
drwxr-xr-x  2 faheem faheem 4.0K Apr 24 20:14 backup-bar
drwxr-xr-x  3 faheem faheem 4.0K Apr 24 20:29 backup-foo
drwxr-xr-x  3 faheem faheem 4.0K Apr 24 19:34 backup-INBOX
drwxr-xr-x  3 faheem faheem 4.0K Apr 24 20:30 backup-Mail
drwxr-xr-x  3 faheem faheem 4.0K Sep 20  2016 backup-test
What is 500 and how do I reverse whatever I did?
Oh yes, and I followed this with:
root@faheem:/mnt# chown root:root .
Maybe I should post to the site, though I'll feel rather like an idiot.
 
6:36 PM
@FaheemMitha 500 is a group ID without a proper name in /etc/groups.
 
@FaheemMitha man 2 mmap
 
@Kusalananda Well, that's cheering.
Any idea how to fix what I did, or should I post to the site?
 
I vaguely recall that someone (RedHat maybe?) used to use 500 as the first non-system group id
 
Hmm... that would be your /, right?
 
@Kusalananda Are you asking me?
 
6:38 PM
Yes. What does ls -ld / say?
 
root@faheem:/# ls -ld /
drwxr-xr-x 22 root 500 4096 Mar 11 18:10 /
 
@derobert This is precisely what I wanted.
 
@FaheemMitha That's slightly odd.
 
I was considering protecting process memory, and using signal handlers to disassemble and modify the (to-be-restarted) instruction in the process context such that it would run a synchronization routine after a write using pipes.
This is more sane.
 
@Kusalananda Actually, this seems to be unrelated to the commands I typed. I see it was there before.
 
6:43 PM
@FaheemMitha Ok, I don't dare suggest fixing it, because I don't know what it should be on your system and what would be affected by changing it.
 
@Kusalananda It could be some artifact of the VPS. It's on some remote system - not mine.
 
@Micrified Glad it helped. BTW, if you have questions about, e.g., C code you're writing, Stack Overflow is probably the best place for it.
 
faheem@faheem:/mnt/backup-foo$ rm -rf .
rm: refusing to remove '.' or '..' directory: skipping '.'
Folks, why does rm -rf . try to remove ..?
 
@FaheemMitha Good. Your system is working!
 
@derobert Yes, well. I am writing C, but a lot of my questions are not so much to do with the language as they are Linux/Unix system calls themselves.
 
6:47 PM
@Micrified We take basic questions on the Unix API here, but we're more focused on sysadmins. SO is focused on programmers.
 
@Kusalananda See my question above. :-)
 
@FaheemMitha No, it's not trying to remove .., it's just informing you that . and .. are special and that it can't remove these. Then it says it's skipping .
 
@Kusalananda Um, is that because .. is listed in the directory?
 
@FaheemMitha We have a question about this somewhere... hold on...
 
@derobert Is there a better stack exchange site for whatever you would call those who live between both?
I'm already in the C room, and it's quite empty except for my ramblings lately.
 
@Micrified Questions really ought to go on the site. At least once they're focused enough.
 
@Kusalananda Thank you.
 
... and SO definitely has plenty of activity, even if not all of its chat rooms do.
 
You're referring to the killing fields I assume. Also know as the "new questions" with the C tag.
 
@Micrified e.g., see this one (answered in the comments, unfortunately) stackoverflow.com/questions/13759308/…
Not sure what you mean by killing fields.
 
6:54 PM
I've spent a fair amount of time asking and answering C questions before. I find the user base that trawls them are pretty harsh when it comes to judging "good" questions and I'm often left without answers. Judgment such as "This isn't C related so I'm closing it" for subtleties like being more of an Operating Systems specific questions.
 
@derobert Sounds like comp.lang.c reborn to me.
 
I won't bombard this room though, don't worry.
Thanks for what you've linked me thus far. It's really great.
 
@Micrified Weird, Stack Overflow ought to take OS-specific questions.
They are definitely a big city compared to here, and all the less-friendliness that implies.
 
By the way, wouldn't you consider SuperUser to be the more "sysadmin" exchange site ?
 
@Micrified No, not really. I think of them as more Windows... They have some Unix/Linux questions there too (our scopes overlap), but mostly they're Windows.
 
6:57 PM
@Micrified Stack Exchange isn't the only game in town.
You might have heard of these legendary things called Usenet and IRC.
 
Stack Exchange sites often have overlapping scopes.
 
I particularly recommend Usenet, which I think still exists.
 
We overlap with Ask Ubuntu, too.
And sometimes Ask Different.
 
Is comp.lang.c still around? I bet it is.
 
Never used Usenet. The stack exchange network's been the only real thing I've gown up with as a resource.
 
6:58 PM
@Micrified I'd give it a try.
 
@FaheemMitha Well, I'm sure it still exists... no idea how much traffic it has.
 
If you are having problems with SE.
Not all SE sites are friendly. SO certainly isn't.
For one thing, I think it's become too big. It's lost that community atmosphere, if it ever had it.
 
I'll check once I figure out what a Mutt newsgroup specification looks like. Not going to try running Pan remotely...
@FaheemMitha It had it early on. It wasn't always the big city.
 
Having said that, there is no harm in asking Unix system call type questions here.
There are differences of opinion about this, but the worst that can happen is that your question will be closed.
@derobert I expect so. But that hasn't been the case for awhile now.
 
... and moved to Stack Overflow :-/
 
7:01 PM
Well, I can attest to the C tag being one of the worst to try and participate in. The feeds are full of homework questions for the most part, and I feel like it's maybe partially why those answering it are so cynical.
 
@derobert Yes, that.
@Micrified That's too bad.
 
@Micrified That could be. But then they'll likely jump on any real question they see.
Given, been a while since I've been active on SO.
 
@Micrified Have you actually tried asking questions there, or is this a hypothetical worry?
 
I have.
You can check my activity.
 
@Micrified And the response was... not positive?
 
7:04 PM
I've had cases where I spent an hour in a half in chat improving my question after I accidentally linked it there.
Because it didn't fulfill every aspect of the "Good Question Guide", or whatever they've called it.
 
Well, my test script shows the same issue. Now to figure out why it's doing it.
@Micrified Useful, or a waste of time? Or a mix?
 
Now obviously you should follow the guide, but sometimes certain programs or questions aren't easy to replicate exactly or the code involved is so large it's usually not very useful to put in the question for readability.
 
Learning to write isn't a bad way to spend the time, but it's not clear if that is what you were doing.
 
No, what I was doing was trying to clear up every single piece of code so that one guy would remove his down vote.
 
@Micrified Indeed. But then it's also very hard for anyone to help you. "There is a bug somewhere in my 50kloc" ...
 
7:06 PM
That involved checking things that didn't need to really be check in my opinion.
Changing the types to those he wanted
And more.
 
@Micrified Did it improve the question?
 
In the end it had no effect, because it was irrelevant to the problem.
 
Or was it irrelevant?
@Micrified Ok. Then indeed it doesn't sound very useful.
If they are going to be very fussbudget about things, that doesn't sound very useful.
Folks, just to check chown -R, like all the other -Rs, goes downwards, right?
@Micrified Anyway, U&L is certainly friendlier, though like everything else, it's relative.
 
So... got Thunderbird to work.
Well, sort of, because wow is it pegging the CPU...
 
@derobert You could use slrn instead. For example.
 
7:17 PM
Well, it seems like you could still read comp.lang.c., as long as you set up a killfile.
 
@derobert Is it active? I don't think I have a Newsgroup server to connect to.
 
yeah, most recent post is less than an hour ago
500 headers only got me back to Apr 14.
 
If anyone knows a server I could connect to, let me know.
Though these days I think you have to register first.
@derobert But how much of it is spam?
 
@FaheemMitha There appears to be a not very good troll, but only one in the messages I looked at.
 
@derobert Encouraging...
Good to know that old traditions die hard.
 
7:20 PM
Ok, two trolls. Found another. Or at least another From line.
c.c.c-programming appears dead & hopeless
c.l.c.moderated is dead
c.l.c++ looks OK, again after killfiling a troll or two
 
@derobert What server are you using? And could I use it?
 
I'm using UseNetServer.com, but it's a paid service...
 
I've got the line:
{ borg check faheem@$SERVER:/mnt/backup-foo 2>&1 1>&3 | tr '\r' '\n' | grep -Ev "^Remote:\s*(Checking segments.*)?$" 1>&2; } 3>&1
What does that gibberish at the end do? It looks like it's swapping descriptors around.
I mean, this bit: 1>&2; } 3>&1.
 
Yeah, that's definitely swapping around file descriptors
 
@derobert I assume this is bundled with other stuff.
Otherwise I can't imagine why you would be paying for Usenet.
@derobert Could you tell me off the top of your head was the purpose is?
I think 3 was created. 1 is standard, 2 is error?
 
7:26 PM
yep, 1 is stdout, 2 is stderr
 
stdout, that is.
So stdout is being sent to stderr.
 
so that is probably passing stderr through the pipeline (instead of stdout like normal)
 
Is that right?
If so, what about 3>&1?
I really should annotate these things.
 
I think that's putting it back... but I need to look up redirect syntax to read it. There ought to be a cundecl equivalent for shell redirects!
 
cundecl?
Oh, yes, now that I think of it, I think:
Checking segments
 
7:29 PM
$ cdecl explain 'char (*p)[]'
declare p as pointer to array of char
 
Was being sent to standard error for some reason. Which is weird.
 
... cundecl was a shortcut to cdecl explain at some point, I think
$ cdecl explain 'char (*p(void))[]'
declare p as function (void) returning pointer to array of char
... because otherwise reading C's variable declaration syntax is impossible :-(
 
Hmm.
C++ isn't much better these days.
Different kinds of impossible.
 
C++ inherited C's syntax.
 
@derobert And added extra fun stuff.
I was referring to the extra fun.
 
7:33 PM
Of course, you didn't notice that C can't actually handle that declaration I gave :-)
 
@FaheemMitha It filters out (removes) the Checking segment lines from the standard error stream of borg check. Without merging the stdout and stderr streams into a single output stream.
 
@Kusalananda Impressive. You figured that out from that stream of gibberish?
 
@Kusalananda must remember how chains of redirects work... I don't :-(
 
@Kusalananda Does it look like it works as intended? Because the script stops there.
For reasons I'm trying to figure out. Sigh.
 
@FaheemMitha Stops, as in terminates?
 
7:35 PM
@Kusalananda Correct.
 
Oh. I wonder, was fd 3 in use?
 
... and/or is set -e making it terminate?
 
@Kusalananda Dunno. Let me try without set -e.
 
Neither shell I used had the script itself open as 3 (bash used 255, dash 10)
 
set -x is echo, set -e is exit on error, right?
 
7:38 PM
Which makes sense, as I think POSIX says up through 9 are available to script author
@FaheemMitha yep
 
@derobert Ok, thanks.
@derobert I don't follow. "the script itself"?
 
@FaheemMitha The interpreter needs to keep the script file open to read it. It does so on some file descriptor.
 
@FaheemMitha bash has to have script file itself open to read it, it uses fd 255 for that. dash uses fd 10
 
Oh, I see.
 
If you messed with that file descriptor, it'd clearly break badly.
Or if you closed it, probably just exit.
 
7:40 PM
Presumably some fds would be reserved for the user.
And that's probably documented somewhere.
 
@derobert Or you could inject code...
 
Probably also shell-specific.
 
@FaheemMitha POSIX I believe guarantees you up through fd 9.
 
If I take out -e, it keeps going. @Kusalananda.
 
which is presumably why dash uses 10
 
7:42 PM
Could use some larger integer.
 
dash is intended, I believe, to be maximally strict. Or at least one of its predecessors was.
 
But I think exit on error is a good policy for a backup script. Thoughts?
 
Hmmm... I wonder, is grep not matching anything and thus being treated as an "error" by set -e?
 
Back in a few min.
 
@FaheemMitha Complain, definitely. But mostly I'd prefer a backup script to continue on error, at least if its safe. E.g., just because backup 2 out of 10 failed, I still want 3–10 tried!
 
7:46 PM
@derobert Is that what POSIX means by "for use by the application" in this section?
 
@EliahKagan yep
 
Makes sense. I had heard POSIX guaranteed that but I oddly had trouble finding it. Looking at various sections, it uses the phrase "the application" to mean the script or commands the shell is running, throughout the document, but I don't think I had put two and two together.
 
@derobert You make a good point, certainly.
 
Some things it makes sense not to do on error (e.g., expire old backups)
 
But (I think) my thinking was that within the same backup it might make sense to exit.
But is there a clean way to arrange that within one script?
 
7:55 PM
If it gets an I/O error on one file, I still want the rest backed up.
 
(I hope that made sense...)
@derobert Hmm.
 
Generally the making backup bit should, I think, continue if at all possible, completing as much of the backup as possible...
 
@derobert Is there an easy way to see what exit status is?
 
echo $?
 
@derobert That would be the line after the line I want to know the exit status of?
 
7:59 PM
yes, every command sets $? to its exit code
 
02:00 - 20:0020:00 - 21:00

« first day (2754 days earlier)      last day (2192 days later) »