From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?B?RnLDqWTDqXJpYw==?= Perrin Newsgroups: gmane.emacs.help Subject: Re: What's wrong with this code?? Date: Tue, 18 May 2010 16:37:39 +0200 Organization: ENST Bretagne Message-ID: References: <65c33ee7-8443-4cec-8227-9005bf4fe494@v29g2000prb.googlegroups.com> <87eiha5ipf.fsf@fh-trier.de> <47907911-2186-4668-81d3-e0475196ade1@n37g2000prc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291929430 2819 80.91.229.12 (9 Dec 2010 21:17:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 21:17:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 22:17:06 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQnrN-0002D7-V2 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 22:17:06 +0100 Original-Received: from localhost ([127.0.0.1]:47983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQnmS-0006q4-3x for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 16:12:00 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-2.dfn.de!news.dfn.de!newsfeed.straub-nv.de!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!crihan.fr!news.univ-lille1.fr!utc.fr!enst-bretagne.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: pc-df-203.priv.enst-bretagne.fr Original-X-Trace: matell.enst-bretagne.fr 1274193459 18719 10.29.221.3 (18 May 2010 14:37:39 GMT) Original-X-Complaints-To: abuse@enst-bretagne.fr Original-NNTP-Posting-Date: Tue, 18 May 2010 14:37:39 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:u69xfTLTjBjeTTqI5MH8i1s737o= Original-Xref: usenet.stanford.edu gnu.emacs.help:178239 X-Mailman-Approved-At: Thu, 09 Dec 2010 16:05:43 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77076 Archived-At: Santanu writes: > On May 18, 2:20 am, Andreas Politz wrote: >> Santanu writes: >> > Can you tell me what is wrong with this code: >> > ------------------- >> > (setq >> >    go-packages-installed >> >    (split-string >> >     (shell-command-to-string >> >      "cd $GOROOT/src/pkg && find . -iname *.go | sed -e 's|^\./||g; s|/ >> > [^/]*\.go||g' | sort | uniq"\ >> > ))) >> >> You have to escape the backslash characters, because of string >> expansion. > > BTW, can you also explain a bit what it means when I don't put the > double backslash character, and instead use a single backslash? I > ask this because my original code (the incorrect one above) did > produce some correct results. The first expression in the sed was « s|^./||g; » (which didn't hurt, because it seems that you don't have directories whoose name contains only a single letter), and the second wes « s|/[^/]*.go||g », with the LHS matching strings such as « /svgo ». -- Fred