From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: linuxfever Newsgroups: gmane.emacs.help Subject: Re: Pipe bash file contents to shell Date: Thu, 30 Jun 2011 13:48:24 -0700 (PDT) Message-ID: <31968005.post@talk.nabble.com> References: <31963679.post@talk.nabble.com> <4E0CB9F9.5060100@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309485533 31369 80.91.229.12 (1 Jul 2011 01:58:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 01:58:53 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 01 03:58:49 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcT0K-00060r-IN for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jul 2011 03:58:48 +0200 Original-Received: from localhost ([::1]:45491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcT0J-0002Uc-0Z for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Jun 2011 21:58:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcO9z-0003o2-PU for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 16:48:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcO9y-0000LK-7W for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 16:48:27 -0400 Original-Received: from sam.nabble.com ([216.139.236.26]:52926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcO9x-0000LG-TP for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 16:48:26 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QcO9w-0001QH-Jh for Help-gnu-emacs@gnu.org; Thu, 30 Jun 2011 13:48:24 -0700 In-Reply-To: <4E0CB9F9.5060100@easy-emacs.de> X-Nabble-From: linuxfever@yahoo.gr X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-Mailman-Approved-At: Thu, 30 Jun 2011 21:57:00 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81462 Archived-At: So, the idea is that my script will contain lines of this form: ./c_code args where c_code is a C program in the same directory where my bash file is. Therefore, the idea is the following: 1) Highlight line 2) open shell (if one does not exist already) and cd to the directory where the bash file is 3) send the line to the shell Ideally, all this would be happening in the background; something similar t= o what ESS does for the R language. Thanks for your help! Andreas R=C3=B6hler wrote: >=20 > Am 30.06.2011 16:33, schrieb linuxfever: >> >> Hello all, >> >> I was wondering whether there is a way to pass contents of a bash script >> file into a shell buffer in Emacs (23.2). For example, if my bash file >> contains a single line "ls -al", I would like to highlight that line, an= d >> by >> pressing a keybind, have the command executed and its output shown in th= e >> shell buffer. >> >> Is it at all possible? Thanks for any suggestions! >> >> >=20 > eh, correcting my previous messages. > "shell-command-on-region" is here not the right starting point. >=20 > So let me consider your question again: >=20 > you have a bash-script. To which directory would `ls -al' point? > How it's written? >=20 > Basically it's possible. > However, maybe to get the results you want, Emacs provides better ways,= =20 > for example via dired. >=20 > Andreas >=20 >=20 >=20 --=20 View this message in context: http://old.nabble.com/Pipe-bash-file-contents= -to-shell-tp31963679p31968005.html Sent from the Emacs - Help mailing list archive at Nabble.com.