Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bash]

The tag has no usage guidance.

0
votes
1answer
22 views

Making Emacs show the last part of bash-command output

I use the Evil mode inside Emacs for doing a lot of my work. If I need to run a shell-command and see its output all I need to do is type in normal mode :!<bash command>. The window splits into ...
0
votes
1answer
29 views

How to get bash source code blocks to execute .profile / .bashrc

I don't understand how the source code blocks work exactly. There are some variables, definitions and aliases in my .bashrc that I think I should be able to use in the source code blocks. However, ...
1
vote
1answer
76 views

Emacs opens gitbash in new system window

I've try to follow this question and sulution Git Bash in emacs on Windows I have this function: (prefer-coding-system 'utf-8) (defun git-bash () (interactive) (let ((explicit-shell-file-name "C:/...
1
vote
1answer
112 views

M-x shell from MSYS2: cannot set terminal process group

I'm using MSYS2-x86_64, and whenever I do M-x shell I see the following: bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell ]0;~/.emacs.d ...
3
votes
1answer
45 views

completion for .bash_history

I am considering implementing an ivy-powered bash_history greper for term-mode, but before I do I wanted to know if this has already been done, by some fancy company-bashhistory package or whatever. ...
1
vote
1answer
64 views

Set custom bashrc or PS1 variable

I'm using, at the terminal on my android device, an simple approach to show the path to my location (export PS1="(\w)$ "). However, the \w seems to not be working in emacs shell emulator running ...
1
vote
1answer
69 views

How to turn off line wrap when opening from terminal

I'm trying to open a file from terminal and ensure that line-wrap will be off. I'm trying the following code, but it won't work emacs --no-window-system --eval '(setq truncate-lines 1)' file I don't ...
3
votes
2answers
76 views

How to sort bash functions alphabetically?

My boss is a bit of a neat freak. He wants the functions in my functions.sh be ordered alphabetically. foo() { echo foo } baa() { echo baa } So baa should appear first in the file. Can emacs ...
1
vote
1answer
37 views

Eshell simple echo in parenthesis not working

Why doesn't the following work in eshell $ (echo "foo") Symbol's function definition is void: echo What I tried: googled eshell parenthesis not working More Context: Eventually I'm trying to ...
1
vote
0answers
114 views

notmuch doesn't show INBOX (“Spawning child process: Invalid argument”)

I'm trying to get notmuch working on Windows 10 using WSL/Ubuntu. The idea is to treat the WSL as a remote machine (roughly following https://notmuchmail.org/remoteusage/) and to have a shell script ...
1
vote
1answer
102 views

How do you abort an emacs M-x compile compilation

How do you abort an emacs M-x compile compilation? I'm editing a bash file, and I "test execute it" by doing M-x compile. What I tried - googled:emacs abort compilation The file I'm working on is ...
1
vote
1answer
78 views

How can I tail/stream output when evaluating org babel shell blocks?

I learnt about asynchronous execution of org babel shell code blocks, thanks to: How is #+BEGIN_SRC sh :results drawer different to #+BEGIN_SRC sh I want to know if it's possible to tail/stream the ...
5
votes
1answer
1k views

How to fix “Symbol's function definition is void: org-babel-get-header”

How do you trouble shoot this? (trying to run a sh block async) #+BEGIN_SRC sh /tmp/7.sh ...
1
vote
0answers
148 views

How is #+BEGIN_SRC sh :results drawer different to #+BEGIN_SRC sh

While reading http://www.howardism.org/Technical/Emacs/literate-devops.html I saw the author recommending #+BEGIN_SRC sh :results drawer for "time-consuming and verbose" commands. (I do a ...
3
votes
1answer
400 views

Remote shell path - env: No such file or directory

In Emacs, when I open the file /ssh:USER@HOST:/PATH, Tramp mode kicks in and everything is great. While editing the file, I want to open a remote shell as well using M-x shell, but its behaviour is ...
0
votes
1answer
205 views

Git bash opens in window outside of emacs

When running Emacs on Windows 10, I am able to launch git bash from within Emacs using the information given here, here, or here. For example, I can just add these two lines to my .emacs: (setq ...
0
votes
0answers
23 views

How to make compile function obey my .bashrc when compile is called by some library?

In my ~/.bashrc I've got some changes, the most important one being the change to $PATH. One of the commands I'm using runs through the compile function, but it fails - bash can't find the binary. ...
0
votes
0answers
44 views

How to run console command on MS Windows, asynchronously, without opening a buffer?

I need to run this command: AcroRd32.exe /A "page=3" "c:/Users/A_User/Some Random File.pdf" shell-command (with appending & at the end) is pretty close, but it opens a buffer which I don't need. ...
0
votes
1answer
239 views

Run Emacs command from terminal

Is there a way to open a file on emacs, execute a command and quit, quietly? I tried emacs file --eval '(progn (cmd) (kill-emacs))' But if I execute this, emacs shows up briefly before quitting. Is ...
2
votes
1answer
353 views

Flycheck gives errors, when I use shellcheck as linter for bash scripts

I use GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-06-09, and Shellcheck 0.3.7 als linter for bash scripts (https://www.shellcheck.net). When I open a bash script, I ...
2
votes
1answer
915 views

Emacs can't find Node when Node was installed using NVM

I've got Node installed using NVM, and Emacs (v25.2.1) isn't able to find Node. When I run M-: (executable-find "node") I get back nil. However, when I run M-: (executable-find "cat") I get "/bin/cat"...
1
vote
1answer
109 views

Suspend frame, run a bash command, sleep for a few seconds and come back to emacs

[ I'm using the latest emacs, and always emacsclient with the -nw option in a terminal ] I have this workflow I want to "automate" with an emacs hotkey. I find myself doing this over a hundred times ...
1
vote
2answers
238 views

tramp and fish shell (local)

How to setup emacs tramp to open remote files while local shell is fish? More precisely is how to ask tramp to use bash shell instead of one named in SHELL environment variable?
2
votes
1answer
355 views

Linter for Google shell style guide?

Does anyone know of a Bash linter for the Google shell style guide? I have been using shellcheck as my linter with flycheck but it doesn't conform to this standard.
0
votes
1answer
436 views

Ansi-Term not reading .profile

my question is very similar to this one. I use my .profile file to set environment variables, such as EDITOR. However, when I run ansi-term and type printenv I can see that that variable is not ...
2
votes
0answers
608 views

Using Windows bash as the shell

I'm trying get Spacemacs (i.e., Emacs) to use the Windows subsystem for Linux bash shell as the shell. I've added (setq explicit-shell-file-name "c:/Windows/System32/bash.exe") to my .spacemacs ...
0
votes
1answer
184 views

External command doesn't run in GUI mode

I have the following function attached to f2 key in latex mode: (defun latex-compile () "Runs pdflatex on current file" (interactive) (let* ((file-name (shell-quote-argument (buffer-...
0
votes
1answer
71 views

Garbage prepended to PATH

For some reason, some garbage is prepended to my PATH variable in emacs. Testing from eshell: (M+x eshell): ~/projects/rust/logentries-parser/src $ echo $PATH bash: cannot set terminal process group ...
1
vote
0answers
202 views

ansi-term changes in line-mode not registered after char-mode

Here's the situation. I start M-x ansi-term, which launches it in term-char-mode. I type the following: echo "hello world" and press RET, which outputs on the next line the expected output hello ...
3
votes
0answers
34 views

Highlight variables without $ inside (( )) when in sh-mode?

Is there a way to modify sh-mode to highlight variables inside a double parentheses construct when not using the dollar sign prefix? For example I want the i to be highlighted in ((i++)) without the ...
3
votes
0answers
297 views

Terminal Buffer: error in process filter: Invalid face: unspecified

On Fedora 25 with GNU Emacs 25.1.90 (which I am running via an AppImage, you can download it from here and test out your theories as to what's wrong if you would like, remember AppImages will only ...
10
votes
2answers
4k views

.bash_profile or .bashrc for shell in emacs?

I wrote an alias for a huge command and stored it in .bash_profile and to my surprise, emacs didn't pick up the alias that I wrote in .bash_profile. After some searching in the internet, I created a ....
2
votes
1answer
622 views

how to automatically open .ics file after org-icalendar-export-to-ics?

I use org-icalendar-export-to-ics to export org-agenda scheduled tasks to iCal format, which works nicely. In my use case, I always select export the "current file" (as opposed to "combine all agenda ...
1
vote
2answers
2k views

No such file or directory error on executing script

I use GNU Emacs 24.3.1 on Ubuntu 14.04 and I have a bash script: ~/path/to the/script/test.sh. As you see the path has space character. Script has a simple content: ENTRY=`zenity --password --...
5
votes
2answers
277 views

sh-script alignment issues

I'm sure emacs used to do it my way, but things appear to have changed (probably years ago, I've just been living with the pain). I want this (to conform to corp. standards): MULTIFORM=$( curl -...
1
vote
1answer
78 views

emacs theme changes when i moved to zsh from bash

I recently shifted form bash to zsh and also installed ohmyz. Since then my emacs theme doesn't work. the one on the Left is how it looks in bash. On the right, when run on zsh its different. Thanks,....
9
votes
3answers
3k views

Set indentation for shell script function

I am trying to set the number of spaces per indent for starting a new function in sh-mode (bash sub-mode). I have tried setting: '(sh-basic-offset 2) '(sh-indentation 2) '(smie-indent-basic 2) (as ...
2
votes
2answers
4k views

copy from shell and paste in terminal-emacs

How can I copy from the command line and paste in Emacs in terminal mode? If I select the text with the mouse and paste it from the clipboard with the third button (the wheel) it is OK. But if I try ...
2
votes
2answers
2k views

Tramp: Waiting for prompts from remote shell

I added two new lines to my .bashrc so that Bash can find my Go programs: GOROOT=/Users/jay/work PATH=$PATH:$GOROOT/bin But as a result, when I launch Emacs, Emacs hangs for several minutes and I ...
0
votes
1answer
95 views

Bash command to see a list of all open buffers

I am in bash and emacsclient is running. I would like to run a bash command to display a list of all open emacs buffers. The output of buffer-menu is fine. These commands do not work: emacsclient -e ...
0
votes
0answers
23 views

Odd filename parsing error when scripting emacsclient on OSX

I get the same error as this Stack Overflow asker when trying to use a wrapper script to tell OSX where the emacs server socket is: I don't think it's a bash issue, as the Emacs PID is correctly ...
7
votes
3answers
5k views

Git Bash in emacs on Windows

I can run the Bash shell that comes with Git for Windows. I put this in my .emacs: (defun git-bash () (interactive) (let ((explicit-shell-file-name "D:/Program Files/git/bin/bash")) (call-...
3
votes
0answers
198 views

Emacs 25 + comint + -nw = eaten newlines

I've been building and running Emacs 25 prereleases on a recent Fedora system that I usually access via ssh. I usually run this emacs in a terminal, and I'm fond of using ansi-term inside it. I've ...
2
votes
1answer
122 views

How can i use a different shell in Emacs Shell?

I am currently using Zsh in my regular terminal app on my Mac OS X. However, it's heavily customized and colors don't appear properly inside Emacs. So I am thinking, I should probably use shell-mode ...
1
vote
1answer
36 views

Can I use find to pass a list to emacs commands?

I'm trying to modify a script I got from an old question of mine. I have many .org files under many subdirectories of ~/foo. I want to quickly run htmlize on each .org file. I have some elisp code $ ...
5
votes
1answer
1k views

How to pass environment variables to org source BASH script block?

I have a BASH script in org-mode file as org-babel source block. I hope to pass value contains environment variable to it through :var. something like these: #+begin_src sh :var VAR1="~/foo" mkdir ...
13
votes
2answers
474 views

Highlighting shell variables within quotes

In vim, the following document will cause the $PWD on lines 2 and 3 to be colored in two different ways: #/bin/sh echo "Current Directory: $PWD" echo 'Current Directory: $PWD' The first instance of $...
10
votes
2answers
746 views

Make emacsclient create a frame only if there isn't one already

How can I make emacsclient -a '' -n create a new frame only if there isn't one already? The problem with the -c flag is that it creates a new frame every time. The problem without it is that if there ...
5
votes
2answers
2k views

how to set environment variables={EDITOR, VISUAL} to prefer running emacs?

my usecase I'm currently running GNU Emacs version=24.3.1 graphically (i.e., under GNOME/X though started from a script invoked from a gnome-terminal running bash) on a Debian Linux. Just now I was ...
13
votes
2answers
989 views

Why does typing '<<<' instead produce '<<EOF\n<' when in shell-script mode?

Whenever I'm editing a shell script in emacs and type three chevrons to redirect a raw string to stdin, emacs inserts the characters 'EOF' and a new line in between them, so cat <<< 'some ...