[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script does not do what it is told to do



On 25/10/2019 14:11, Greg Wooledge wrote:
On Fri, Oct 25, 2019 at 08:33:09AM +0100, Michael Howard wrote:
On 24/10/2019 23:37, Ken Heard wrote:
#!/bin/bash
# Script to back up all browser files in directory /home/ken/mozilla.
STARTDIR=$PWD
cd /home/ken
tar -czf /media/fde/backups/kbrowsers.tgz  --exclude-caches \
- --wildcards -T docs/tarlists/kbrowsers.lst
cd "$STARTDIR"
There is nothing inherently wrong with the script,
Untrue.  I pointed out the flaws last time this subject was discussed
on this mailing list.  Was that just a few days ago, or was it last
week?  I don't remember.


Sorry, but it _is_ true. One can't know, nor should one, if the variables and paths are correct, but if they are, i.e. all things being equal, the script  is inherrently correct. Of course, it certainly isn't optimal.


in that it would work if
all other things were equal, but they are clearly not.
Lots of scripts will work "if certain conditions hold true".


See above.


That's the
fundamental problem here.  The script shown here is incredibly fragile,
and the author did not correct the flaws that I already pointed out
last time.  It may "work" under certain conditions.  How likely those
conditions are to be true, I have no way to know.


I have no idea about when or where the OP may have posted previously.


Using the -C option to tar is preferable to the way you are doing it.
Yup, that was one of the three(?) proposals I made last time around,
none of which were followed.  *shrug*  Not much more I can do when
nobody listens to me.


With your attitude, little wonder nobody listens to you. You're probably on the ignore list :)

Mike.

--



Reply to: