[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
perfect sense.

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:

 https://svn.jj5.net/jjrepo/jj5-bin/branches/0.2/bin/inc/aliases.sh#l7

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
a
jj5 at tact:~/desktop/experiment$ cat file.txt | head -2
a
b
jj5 at tact:~/desktop/experiment$ cat file.txt | head -3
a
b
c
jj5 at tact:~/desktop/experiment$ cat file.txt | head -4
a
b
c
jj5 at tact:~/desktop/experiment$ cat file.txt | head -$RANDOM
a
b
c

-- 
|_|O|_| ProgClub
|_|_|O| Because every programmer needs a good club!
|O|O|O| https://www.progclub.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jj5.vcf
Type: text/x-vcard
Size: 231 bytes
Desc: not available
URL: <http://www.progclub.org/pipermail/programming/attachments/20190619/187803da/attachment-0001.vcf>


More information about the programming mailing list