From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Herzig Subject: Re: passing string to sh source code block Date: Sat, 16 Mar 2019 13:07:25 +0000 Message-ID: References: <878sxfdlzi.fsf@outlook.at> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:40714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h596N-0001c4-2T for emacs-orgmode@gnu.org; Sat, 16 Mar 2019 09:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5928-0003Oq-TN for emacs-orgmode@gnu.org; Sat, 16 Mar 2019 09:07:29 -0400 Received: from mail-oln040092069051.outbound.protection.outlook.com ([40.92.69.51]:39557 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5928-0003JK-IC for emacs-orgmode@gnu.org; Sat, 16 Mar 2019 09:07:28 -0400 In-Reply-To: <878sxfdlzi.fsf@outlook.at> (Daniel Herzig's message of "Sat, 16 Mar 2019 13:47:45 +0100") Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Orgmode Mailing List Sorry, I found my mistake. I'll post it anyway, maybe it's of use to someone. My path contains spaces, so I had to change the code a bit (see below). Daniel Herzig writes: > Hi! > > I am trying to pass a path to an org-source-codeblock using the :var tag > in the header: > > #+BEGIN_SRC sh :var directory=3D"/x/y/z" > cd directory > ls > #+END_SRC #+BEGIN_SRC sh :var directory=3D"/x/y/z" cd "$directory" ls =20 #+END_SRC Like this it works as needed. > The output of the ls command shows that I obviously stay in the location > of my .org file (not "/x/y/z") -- is there a way to pass the path to the = source > codeblock, without having to enter the path inside the block? > > Any hint appreciated, thanks in advance, > > cheers, > Daniel