Re: Auto-load safe-path and auto-load scripts-directory on Windows

asmwarrior <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 2015-10-10 21:17, Eli Zaretskii wrote:
>> Date: Sat, 10 Oct 2015 21:24:45 +0800
>> From: asmwarrior <[email protected]>
>> CC: [email protected], [email protected]
>>
>> 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"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.