unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: linuxfever <linuxfever@yahoo.gr>
To: Help-gnu-emacs@gnu.org
Subject: Re: Pipe bash file contents to shell
Date: Thu, 30 Jun 2011 13:48:24 -0700 (PDT)	[thread overview]
Message-ID: <31968005.post@talk.nabble.com> (raw)
In-Reply-To: <4E0CB9F9.5060100@easy-emacs.de>


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 to
what ESS does for the R language.

Thanks for your help!



Andreas Röhler wrote:
> 
> 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, and
>> by
>> pressing a keybind, have the command executed and its output shown in the
>> shell buffer.
>>
>> Is it at all possible? Thanks for any suggestions!
>>
>>
> 
> eh, correcting my previous messages.
> "shell-command-on-region" is here not the right starting point.
> 
> So let me consider your question again:
> 
> you have a bash-script. To which directory would `ls -al' point?
> How it's written?
> 
> Basically it's possible.
> However, maybe to get the results you want, Emacs provides better ways, 
> for example via dired.
> 
> Andreas
> 
> 
> 

-- 
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.




  reply	other threads:[~2011-06-30 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30 14:33 Pipe bash file contents to shell linuxfever
2011-06-30 17:49 ` Andreas Röhler
2011-06-30 18:01 ` Andreas Röhler
2011-06-30 20:48   ` linuxfever [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-06-30 21:52 linuxfever
2011-07-01  2:15 ` William Stevenson
     [not found] <mailman.764.1309451932.785.help-gnu-emacs@gnu.org>
2011-07-01 17:23 ` rusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31968005.post@talk.nabble.com \
    --to=linuxfever@yahoo.gr \
    --cc=Help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).