From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20873 invoked by alias); 10 Oct 2015 14:10:39 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 20864 invoked by uid 89); 10 Oct 2015 14:10:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 10 Oct 2015 14:10:37 +0000 Received: by padhy16 with SMTP id hy16so112583236pad.1 for ; Sat, 10 Oct 2015 07:10:35 -0700 (PDT) X-Received: by 10.66.251.136 with SMTP id zk8mr22975979pac.143.1444486235717; Sat, 10 Oct 2015 07:10:35 -0700 (PDT) Received: from [0.0.0.0] ([107.191.52.102]) by smtp.googlemail.com with ESMTPSA id f5sm8508041pas.23.2015.10.10.07.10.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Oct 2015 07:10:34 -0700 (PDT) Message-ID: <56191EEB.5000200@gmail.com> Date: Sat, 10 Oct 2015 14:10:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Eli Zaretskii CC: jan.kratochvil@redhat.com, gdb@sourceware.org Subject: Re: Auto-load safe-path and auto-load scripts-directory on Windows References: <83io7y3249.fsf@gnu.org> <83h9ni2zij.fsf@gnu.org> <20150829112713.GB3298@host1.jankratochvil.net> <83egim2uqz.fsf@gnu.org> <20150829114356.GA3766@host1.jankratochvil.net> <83a8ta2qsq.fsf@gnu.org> <56186C66.1090907@gmail.com> <83egh3tc84.fsf@gnu.org> <5619119D.7070807@gmail.com> <83egh2sw0e.fsf@gnu.org> In-Reply-To: <83egh2sw0e.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-10/txt/msg00048.txt.bz2 On 2015-10-10 21:17, Eli Zaretskii wrote: >> Date: Sat, 10 Oct 2015 21:24:45 +0800 >> From: asmwarrior >> CC: jan.kratochvil@redhat.com, gdb@sourceware.org >> >> The result is: $debugdir:$datadir/auto-load >> This is the default value, and I have >> >> /* Directories from which to load auto-loaded scripts. */ >> #define AUTO_LOAD_DIR "$debugdir:$datadir/auto-load" >> >> in config.h >> >> But if I change the line to: (note I use the semicolon) >> with_auto_load_dir='$debugdir;$datadir/auto-load' >> >> Then, I get an error: >> $ ./mytest.sh >> $debugdir;$datadir/auto-load >> ./mytest.sh: line 7: /auto-load: No such file or directory >> >> So, it looks like an issue in the eval command? > > The semi-colon is a special character, you need to quote or escape it. > Sounds like this could at least print the ";" by adding two level escapes ------ #!/bin/bash with_auto_load_dir='$debugdir\\\;$datadir/auto-load' escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]\(datadir\|debugdir\)\>/\\\\\\\\\\\\&/g'` echo $escape_dir ac_define_dir=`eval echo $escape_dir` ac_define_dir=`eval echo $ac_define_dir` echo $ac_define_dir ------ My previous example code has a typo, the last line should be "echo $ac_define_dir", not "echo $ac_defefine_dir"