wp-mirror-list
[Top][All Lists]
Advanced

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

Re: [Wp-mirror-list] Attempting to mirror on laptop


From: Benjamin Goldsmith
Subject: Re: [Wp-mirror-list] Attempting to mirror on laptop
Date: Sun, 19 Aug 2012 18:22:15 -0400

Dear Kent,

Thank you for the prompt response.  Here is the information you have requested:

1) BASH

address@hidden:~$ ls -l /bin/*sh
-rwxr-xr-x 1 root root 926536 Apr 10  2010 /bin/bash
-rwxr-xr-x 1 root root 104168 Dec 14  2010 /bin/dash
lrwxrwxrwx 1 root root      4 Jul 10 17:40 /bin/rbash -> bash
lrwxrwxrwx 1 root root      4 Jul 10 17:40 /bin/sh -> dash

address@hidden:~$ man bash
<snip>
CONDITIONAL EXPRESSIONS
       Conditional  expressions  are  used  by the [[ compound command and the
       test and [ builtin commands to test file attributes and perform  string
       and  arithmetic comparisons.  Expressions are formed from the following
       unary or binary primaries.  If any file argument to  one  of  the  pri‐
       maries is of the form /dev/fd/n, then file descriptor n is checked.  If
       the file argument to  one  of  the  primaries  is  one  of  /dev/stdin,
       /dev/stdout,  or /dev/stderr, file descriptor 0, 1, or 2, respectively,
       is checked.

       Unless otherwise specified, primaries that operate on files follow sym‐
       bolic links and operate on the target of the link, rather than the link
       itself.

       When used with [[, The < and > operators sort  lexicographically  using
       the current locale.

       See  the description of the test builtin command (section SHELL BUILTIN
       COMMANDS below) for the handling of parameters (i.e.   missing  parame‐
       ters).

       -a file
              True if file exists.
       -b file
              True if file exists and is a block special file.
       -c file
              True if file exists and is a character special file.
       -d file
              True if file exists and is a directory.
       -e file
              True if file exists.
       -f file
              True if file exists and is a regular file.
       -g file
              True if file exists and is set-group-id.
       -h file
              True if file exists and is a symbolic link.
       -k file
              True if file exists and its ``sticky'' bit is set.
       -p file
              True if file exists and is a named pipe (FIFO).
       -r file
              True if file exists and is readable.
<snip>

I also tried this:
address@hidden:~$ echo $SHELL
/bin/bash

and this:
address@hidden:~# echo $SHELL
/bin/bash

2) DASH

address@hidden:~$ man dash
<snip>
     test _expression_

     [ _expression_ ]
            The test utility evaluates the _expression_ and, if it evaluates to
            true, returns a zero (true) exit status; otherwise it returns 1
            (false).  If there is no _expression_, test also returns 1 (false).

            All operators and flags are separate arguments to the test util‐
            ity.

            The following primaries are used to construct _expression_:

            -b file       True if file exists and is a block special file.

            -c file       True if file exists and is a character special file.

            -d file       True if file exists and is a directory.

            -e file       True if file exists (regardless of type).

            -f file       True if file exists and is a regular file.

<snip>

Note:
address@hidden:~# man sh

displays the man page for dash!

3) wp-mirror

> One possible way for me to eliminate this problem in future would be
> to replace every
>
>           -a file
>
> with
>
>           -f file

I replaced every -a with -f in simplewiki-20120805-pages-articles-p000000000-c000001000.sh and, as you suspected, it worked without complaining and created the proper subdirectories.

> ...replace
> #!/bin/sh
>
> with
>
> #!/bin/bash

Using a another copy of the simplewiki-20120805-pages-articles-p000000000-c000001000.sh with the -a flag still intact, I went ahead and tried this option and it worked too.

As to which solution to use: if for other reasons you are locked into bash, I'd suggest using the #!/bin/bash change.  However, if you want to give people the flexibility to use other shells it would be worth switching to the -f flag since they are shared.  The downside might be if you ever decide to use something in place of a regular image file, such as a symbolic link to the image file.  Then the -e flag might be the best option.

I hope that helps.

Thanks for all of your help, and a special thanks for taking time out on a Sunday to respond.

Best,
-Benjamin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]