In comp.os.linux.advocacy, Roy Schestowitz
on Wed, 22 Feb 2006 17:25:13 +0000
> __/ [ The Ghost In The Machine ] on Wednesday 22 February 2006 17:00 \__
>> In comp.os.linux.advocacy, Roy Schestowitz
>> on Wed, 22 Feb 2006 06:17:33 +0000
>> Shit! Too complicated! Where's my GUI? Where's the
>> ease of use? I wanna mouseclick! WAAAAAH!
>> - hypothetical response from a frustrated Windows user
>> There are a fair number of additional pipelining options,
>> however -- date in particular can print an arbitrary format.
>> But that's what manpages are for. :-)
> Here's one of my latest script:
> cd /tmp/ # need full path for cron
> rm -rf /home/roy/public_html/wordpress #
> wget http://static.wordpress.org/builds/wordpress-`date +%Y-%m-%d`.tar.gz
> rm /tmp/wordpress-`date +%Y-%m-%d`.tar # delete
> gunzip /tmp/wordpress-`date +%Y-%m-%d`.tar.gz
> tar xf /tmp/wordpress-`date +%Y-%m-%d`.tar # uncompress and untar
> cp -rf /tmp/wordpress /home/roy/public_html/ # overwrite old files
> rm -rf /tmp/wordpress # clean up
> Without using semi-colons, it could still be shrunk to occupy just 4 lines
> or so. What does it do? It goes to the WordPress site, it finds the latest
> nightly build, it then downloads it, uncompresses the file, extracts all
> the files, puts them on a public Webspace and optionally protects every-
> Imagine yourself doing all of this in Windows rather than let a cron job
> keep the Web-based software up-to-date, /without/ having /any/ such func-
> tionality at software-level.
> The command-line gives power. If the newbie does not want to be efficient,
> (s)he can use the GUI. It's there, so use it. It has become a streotype
> and a fallacy: Linux users choose the command-line, so the command-line
> must be vital. If you want to burn CD's with nightly copies of your Web
> sites and then open the CD tray in the morning, script it. *Once*. OR
> click your way through life instead. Day, by day, by day...
I'd put those `date...` as a single variable setting (just in case
you run it near midnight! :-) ) but otherwise, yes, that's the general
idea; scripting is very flexible.
Semicolons and newlines are more or less interchangeable anyway,
as far as command termination is concerned.
It's still legal to go .sigless.