[ProgClub programming] Announcing rf.php and rnd()
John Elliot V | ProgClub
jj5 at progclub.org
Wed Jun 19 11:09:07 AEST 2019
On 19/6/19 9:20 am, Jedd Rashbrooke wrote:
> But there are breathtakingly better ways of a) doing backups, and b)
> verifying them, than a) writing your own rinky dinky scripts, and b)
> writing some more rinky dinky scripts to randomly pick a file and then
> open it in vim.
I don't know why you keep going on about how bad it is that I've written
a shell script that uses rsync to do my backups.
You have suggested a while back that I use 'dirvish', but I can barely
believe that you could make such a recommendation with a straight face.
(If you want me to tear strips off dirvish by all means let me know and
I will oblige.)
Beyond 'dirvish' you haven't offered what's better than a shell script
that uses 'rsync'. I mean seriously, what's so bad about that? The
'rsync' program is perfectly suited to doing backups, that's what it's
for. And if you need to run 'rsync' over a bunch of hosts and
directories on a regular basis having a shell script do that makes
And as for "opening it in vim", that was just hand-waving while I
thought about it. I understand that making software is a process, you
don't start at the end, you start at the beginning, and then go through
the middle, and at some point you stop. There never really is an "end".
While you're going through the process you can gloss over, stub out, or
omit bits that you haven't done yet, or maybe haven't even thought about
yet. So for me opening the file in vim was just that, a stub for "what
to do once we've found a random file". Your suggestion of md5sum was a
good one, and now I've added a bunch of other bits too:
May the Force be with you,
John Elliot V
p.s. oh noes!
jj5 at tact:~/desktop/experiment$ echo $'a\nb\nc' > file.txt
jj5 at tact:~/desktop/experiment$ cat file.txt | head -1
jj5 at tact:~/desktop/experiment$ cat file.txt | head -2
jj5 at tact:~/desktop/experiment$ cat file.txt | head -3
jj5 at tact:~/desktop/experiment$ cat file.txt | head -4
jj5 at tact:~/desktop/experiment$ cat file.txt | head -$RANDOM
|_|_|O| Because every programmer needs a good club!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 231 bytes
Desc: not available
More information about the programming