Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: zzapper CC: cygwin AT cygwin DOT com Subject: Re: When are Windows Short Path Names required - jraynersqlzip (1/1) References: <435C2A4A DOT C4D58EA5 AT dessent DOT net> <435CC565 DOT DB98EB45 AT dessent DOT net> <435CCD57 DOT 9010008 AT equate DOT dyndns DOT org> <7mjpl1l8l78083k082e44a79c41ufq7q5f AT 4ax DOT com> <435CD869 DOT 3060408 AT equate DOT dyndns DOT org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/