help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell argument quoting woes


From: Thorsten Jolitz
Subject: Re: Shell argument quoting woes
Date: Thu, 25 Jul 2013 17:28:51 +0200
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Rustom Mody <rustompmody@gmail.com> writes:

> On Thursday, July 25, 2013 7:00:32 PM UTC+5:30, Thorsten Jolitz wrote:
> Seems to me that this inside lisp
>
>> ,------------------------
>> | prg -'fun \"strg\" num'
>> `------------------------
>> How can I quote such a 'cmd' string in a way that it finally arrives as
>
> should be this
>
>> 
>> ,------------------------
>> | $ prg -'fun "strg" num'
>> `------------------------
>
> at the shell... No?
>
> Anyway heres some (not too great) hacking:
> (with my recently learnt from Bastien's C-j!) 
>
> (setq cmd "prg -'fun \"strg\" num'")
> "prg -'fun \"strg\" num'"
> (setq x (split-string cmd "-"))
> ("prg " "'fun \"strg\" num'")
> (setq p (car (split-string (car x))))
> "prg"
> (setq arg (cadr x))
> "'fun \"strg\" num'"
> ; (make-comint "buffer-name" p nil (concat "-" arg))

I see, so the problem was actually the string-splitting by spaces and
not the quoting. Thanks!

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]