delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/24/09:18:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <435CDF4F.2080106@byu.net>
Date: Mon, 24 Oct 2005 07:19:11 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
To: zzapper <david AT tvis DOT co DOT uk>
CC: cygwin AT cygwin DOT com
Subject: Re: When are Windows Short Path Names required - jraynersqlzip (1/1)
References: <gf4ll19t24s5el791n26rudlum24i066ot AT 4ax DOT com> <lebnl1thgfncfg24fmc959nm75o9jtcpp7 AT 4ax DOT com> <435C2A4A DOT C4D58EA5 AT dessent DOT net> <occpl1lckdvle5f09o1vl4a5s0c2vk5hic AT 4ax DOT com> <435CC565 DOT DB98EB45 AT dessent DOT net> <veipl15826m79lf7j6k1nsan77rt27lndl AT 4ax DOT com> <435CCD57 DOT 9010008 AT equate DOT dyndns DOT org> <7mjpl1l8l78083k082e44a79c41ufq7q5f AT 4ax DOT com> <435CD869 DOT 3060408 AT equate DOT dyndns DOT org> <kgmpl15mmrnria0aqnjioba1eotgjeiruk AT 4ax DOT com>
In-Reply-To: <kgmpl15mmrnria0aqnjioba1eotgjeiruk@4ax.com>
X-IsSubscribed: yes
Note-from-DJ: This may be spam

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to zzapper on 10/24/2005 6:56 AM:
Please convince your mailer to send text files with a text mime-type, not
application/octet-stream.  Reposting here for convenience:

#!/bin/bash
# jraynersqlzip
# description : backup Mysql using sja.exe
# date 21Mar05
# v1.0
dirbackup="c:/backup/farms/"
eval filedate=$(date.exe '+%d%b%y')
ls -l $dirbackup/jraynerscheduled.sql

sjaprog="/sqlyog/sja.exe"
sjaprog="c:/progra~1/SqlYog~2/sja.exe"
sjaprog="/cygdrive/c/Program\ Files/SQLyog\ Enterprise/sja.exe"
sjascript="c:/cygwin/usr/local/bin/sql/jrayner.xml"
"$sjaprog" "$sjascript"

ls -l $dirbackup/
cp $dirbackup/jraynerscheduled.sql $dirbackup/jrayner$filedate.sql
ls -l $dirbackup/jrayner$filedate.sql


Here's your problem.  foo="a\ b" puts 4 characters into $foo.  On the
other hand, foo=a\ b puts 3 characters into $foo.  Also, foo='a b' puts 3
characterse into $foo.  Until you have the correct contents in $sjaprog,
then invoking "$sjaprog" will fail.  If you really want 4 characters in
$foo, then you need an eval to reparse the expansion.  Learn how to
properly use shell quotes - it will save you loads of headaches.

$ echo 'echo hi' > ./a\ b
$ foo="./a\ b"
$ eval $foo
hi
$ foo="./a b"
$ "$foo"
hi

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
volunteer cygwin bash maintainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDXN9O84KuGfSFAYARAvSwAJ9VgsC6fUihjopWAfxrhMNCCQorywCfWLgA
c3VTtJ7wFwRJp1v9rfja1xg=
=3L9s
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019