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

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

Re: Examining the output of a shell command?


From: Pascal J. Bourguignon
Subject: Re: Examining the output of a shell command?
Date: Sun, 28 Jun 2015 17:52:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Raffaele Ricciardi <rfflrccrd@gmail.com> writes:

> On 28/06/15 15:57, Pascal J. Bourguignon wrote:
>> (shell-command-to-string "echo $RED hello $NORMAL")
>> --> "[31m hello [0m
>> "
>
> Here is:
>
> (shell-command-to-string "echo $RED hello $NORMAL")
> --> "hello
> "

Of course, you need to define RED and NORMAL in your .bashrc!
You may do so by sourcing: 
http://git.informatimago.com/viewgit/?a=viewblob&p=public/bin&h=5cd80cb6bfe405bcc4f9cf7c4f857845b31d1830&hb=08a0ed1597b44dbb32057924837b1a1aeb4a8d61&f=ansi-codes


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk


reply via email to

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