Subject: bug#22203: closed (Re: bug#22203: 25.0.50; # is treated as a comment character in shell-command arg)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 18 Dec 2015 19:51:02 +0000

Your bug report

#22203: 25.0.50; # is treated as a comment character in shell-command arg

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
22203: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22203
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#22203: 25.0.50; # is treated as a comment character in shell-command arg
From: Kaushal Modi <[email-masked]>
To: [email-masked], Glenn Morris <[email-masked]>
Cc: Wolfgang Jenkner <[email-masked]>
Date: Fri, 18 Dec 2015 14:49:26 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

I am closing this issue.

After further testing.. it turns out that this issue doesn't have to
do anything with emacs.

Here's what happened:

I was running the separate instances of emacs (master branch version
and emacs-25 branch version) from different terminals.
In the terminal where I was running the master branch version (working
case) I was on HOST (env var) X.
In the terminal where I was running the emacs-25 branch version
(non-working case) I was on the same HOST but had to ssh into the same
host X as a hack to fix some group permission issues (at work). That
seemed to mess up the shell-command execution. After I exit from that
ssh session and restarted emacs, this issue was gone, even on
emacs-25.

Subject: 25.0.50; # is treated as a comment character in shell-command arg
From: Kaushal Modi <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Fri, 18 Dec 2015 11:25:07 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I need to run shell-command that has a hash character (#) in it.

Here's is a trivialized example of what I need to do

(shell-command "echo abc#def" "*abc*")

The above works in a terminal and also in the below build from master branch:

Build date        : 2015/11/12 12:45 Thu
Savannah Git link :
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9dd7da9945c16aa343080a535ed74eeecf769fd1

commit 9dd7da9945c16aa343080a535ed74eeecf769fd1
Author: Juanma Barranquero <[email-masked]>
Commit: Juanma Barranquero <[email-masked]>

    * test/automated/keymap-tests.el: New test file

I get the output "abc#def" in both the cases.

But when I do the same in an emacs -Q session on the latest emacs
build on emacs-25 branch, the # is treated as a "comment char" and
everything after the # is not passed to the shell.

So

(shell-command "echo abc#def" "*abc*")

is treated as

(shell-command "echo abc" "*abc*")

I searched the log messages for "shell-command" here:
http://git.savannah.gnu.org/cgit/emacs.git/log/?h=emacs-25 but I did
not find a commit that could have caused this change.

Is this change intentional? If so, how do I pass "#" to the shell
using shell-command?

Thanks!

In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2015-12-17
Repository revision: ecce24b34ba51f10d2a729bf5496a1cbec0bf329
Windowing system distributor 'The X.Org Foundation', version 11.0.60900000
System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago)

Configured using:
 'configure --prefix=/home/kmodi/usr_local/apps/6/emacs/emacs-25
 'CPPFLAGS=-fgnu89-inline -I/home/kmodi/usr_local/6/include
 -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0'
 'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib
 -L/home/kmodi/usr_local/6/lib64 -ggdb3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr
mail-utils time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 82254 6037)
 (symbols 48 19481 0)
 (miscs 40 48 136)
 (strings 32 12980 4411)
 (string-bytes 1 391078)
 (vectors 16 11502)
 (vector-slots 8 429541 5229)
 (floats 8 143 131)
 (intervals 56 232 16)
 (buffers 976 13)
 (heap 1024 30926 755))

--
Kaushal Modi