>>>>> Pete Helgren writes:

 > I may end up going this direction, at the moment I am not having much
 > luck with the conditional copy in Busybox.  Your suggestion:

 > cp -n newdatabase.db /data/newdatabase.db

 > Isn't supported in the version of Busybox that I am running.  Also
 > the script example I tried:

 > if  [ -f /data/newdatabase.db];
 > then
 > echo "Nothing to do, database exists"
 > else
 > cp newdatabase.db /data/newdatabase.db
 > fi

 > delivers the error  [:missing]

        The primary token delimiter in POSIX Shell is space.  Hence, the
        following line:

   if  [ -f /data/newdatabase.db];

        Is understood as: “check if the file ‘/data/newdatabase.db]’
        exists” (note the closing bracket), and it certainly lacks a
        closing bracket for the ‘test’ (AKA ‘[’) command.

        The solution would be as follows:

 - if  [ -f /data/newdatabase.db];
 + if  [ -f /data/newdatabase.db ];

        OTOH, the when the ‘test’ form of the command is used, closing
        bracket is not necessary, thus:

   if  test -f /data/newdatabase.db ;

        Please also consider joining the news:comp.unix.shell newsgroup
        (e. g., on Aioe, nntp://aioe.org/comp.unix.shell/), as there're
        quite a few folks familiar with the arcane art of Unix Shell
        programming.  (AFAIK, Thunderbird has the support for the
        Internet News service.)

[…]

-- 
FSF associate member #7257      Coming soon: Software Freedom Day
http://mail.sf-day.org/lists/listinfo/ planning-ru (ru), sfd-discuss (en)

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to