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: Dan Espen
Subject: Re: Examining the output of a shell command?
Date: Sun, 28 Jun 2015 10:03:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Pascal J. Bourguignon" <pjb@informatimago.com> writes:

> Raffaele Ricciardi <rfflrccrd@gmail.com> writes:
>
>> I would like to analyse the escape sequences emitted by a shell
>> command. I have tried with `shell-command` and
>> `shell-command-to-string`, but escape sequences are stripped away.
>
> Nope. Try a better lie.
>
> (shell-command-to-string "echo $RED hello $NORMAL")
> --> "[31m hello [0m
> "

Maybe the OP doesn't realize that some programs that output
escape sequences won't do so when run as an Emacs shell command.

/bin/ls being a good example.

In that case, run:

/bin/ls --color

as an Emacs shell command.


-- 
Dan Espen


reply via email to

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