Skip to main content

Questions tagged [bash]

Bash is the `Bourne again Shell`, one of the more common Unix shell languages. This tag should be used for questions about editing bash scripts in Emacs, or writing bash scripts that invoke Emacs themselves. This tag doesn't necessarily apply to questions about running a shell in Emacs (which may use a language other than Bash), for which other tags are available.

Filter by
Sorted by
Tagged with
0 votes
0 answers
147 views

I'm using bash-language-server with Eglot. This LSP uses the external shfmt program for code formatting, eglot-format-buffer to be exact. The shfmt tool has a bunch of switches like --case-indent. I ...
Zeta.Investigator's user avatar
0 votes
1 answer
48 views

Why are bash sequence expressions expanded in a normal org-babel source block but not in one attached to a session? #+begin_src bash ...
Rovanion's user avatar
  • 1,077
0 votes
1 answer
144 views

I started to use emacs and orgmode for few weeks. I try to automate the documentation of a tool present on my bash environment and I want to print the help output of inside an org file. In the capture ...
bisnow's user avatar
  • 1
0 votes
0 answers
87 views

I have a script returning: [0m[38;5;16m[48;5;16m▄[0m[38;5;232m[48;5;232m▄[0m[38;5;233m[48;5;232m▄[0m[38;5;233m[48;5;233m▄[0m[38;5;234m[48;5;233m▄[0m[38;5;235m[48;5;234m▄[0m[38;5;236m[48;5;234m▄[0m[38;...
david's user avatar
  • 285
1 vote
2 answers
980 views

I use org-babel-tangle to generate lilypond and latex documents from org files. These org files have the following first line: #+PROPERTY: header-args :LANG :comments org :tangle PATH/FILE_NAME.EXT ...
crocefisso's user avatar
  • 1,549
0 votes
0 answers
121 views

I login to a computer with SSH. In my home directory, there is a file called test.sh with a bunch of BASH code in it. I start editing it with emacs -nw test.sh. It is a large file, and I want to test ...
Dante Picchioni's user avatar
1 vote
1 answer
79 views

When I do $ tree -d -L 3 /usr/share/emacs/28.2/lisp in a bash terminal I get: /usr/share/emacs/28.2/lisp ├── calc ├── calendar ├── cedet │   ├── ede │   ├── semantic │   │   ├── analyze │   │   ├── ...
crocefisso's user avatar
  • 1,549
0 votes
0 answers
112 views

In .screenrc, I have this line: term xterm-256color If I do not use that, or if I try something different (like xterm-color or screen-256color), then emacs has absolutely no color. Here is a font-lock ...
Ness's user avatar
  • 187
0 votes
1 answer
48 views

Looking for this for years. I am going to be brave and ask. (defun paste-hello-world () (paste-raw-text-at-cursor "hello world\n") ) Need something like the above. The place I work at ...
Matthaeus Gaius Caesar's user avatar
0 votes
2 answers
3k views

I am currently using vim editor on Git Bash terminal running in a Windows machine, but I want to switch over to Emacs editor. It is returning bash: emacs: command not found . Do I need to install the ...
Amah N. Lofty's user avatar
0 votes
1 answer
126 views

Often when I issue a bash command, the results opens in a popup buffer, instead of going into the RESULTS drawer. F.ex this command. #+begin_src shell nc -w 2 -v -z danzinger 8507 #+end_src It opens ...
Jason Hunter's user avatar
  • 1,236
0 votes
0 answers
100 views

Below bash script works as a bash script but if execute it in org-babel block as below, it report error: sh: 2: Bad substitution code: #+begin_src sh :results output str="toto.titi.12.tata.2.abc....
lucky1928's user avatar
  • 1,774
0 votes
1 answer
113 views

In sh-mode I am getting following flycheck-error message: File Line [v]ColLevel ID Message (Checker) config.sh 2 error Syntax error: "(" unexpected (sh-posix-dash) ...
alper's user avatar
  • 1,570
1 vote
1 answer
63 views

I have this LaTeX code: %% test.tex \begin{wrapfig} \includegraphics[width=1cm]{fig1.eps}\end{wrapfig} \includegraphics[width=1cm]{fig2.eps} I have a script called fix-files-ext.sh that fixes the ...
Onner Irotsab's user avatar
1 vote
1 answer
2k views

I have a bash script like this: #!/bin/bash cd ~/src/program && rm -rf node_modules && yarn When I invoke this script by executing (shell-command "bash ~/src/helper/script.sh&...
Evgeny Mikhaylov's user avatar
0 votes
1 answer
176 views

I would like to run some commands on remote host before giving control to tramp. E.g., I would like to load easybuild modules to make sure that environment variables are set correctly for ESS. My ...
Iakov Davydov's user avatar
1 vote
1 answer
280 views

I am using Emacs (config file) on macOS Monterey (12.5). There is something that I do not understand. After being queried on a specific version of the program called sdkman sdk, eshell and macOS ...
Pedro Delfino's user avatar
2 votes
2 answers
124 views

This question is in two parts: How to cause emacs linter to recognize an extglob expression as an ability instead of a syntax error? How to cause emacs indenter to recognize an extglob expression as ...
Paul's user avatar
  • 233
4 votes
1 answer
1k views

i'd like to use bash shell from msys2 in emacs and i made the following changes in emacs init file: (setq explicit-shell-file-name "C:/tools/msys64/usr/bin/bash.exe") (setq shell-file-name &...
Quasar999's user avatar
0 votes
2 answers
320 views

I want my eshell to use ~/.bash_aliases. But it seems that it doesn't because my usual aliases do not work. This is my full minimal config using use-package: ;; === Package setup === (require 'package)...
buhtz's user avatar
  • 789
1 vote
1 answer
703 views

I keep seeing following error when I run emacs daemon. Server bash-ls:7089/starting exited with status exit(check corresponding stderr buffer for details). Do you want to restart it? (y or n) When I ...
alper's user avatar
  • 1,570
1 vote
1 answer
64 views

In Shell-script[bash] mode, coloring differs for sh-quoted-exec in #!/bin/sh and #!/bin/bash. If #!/bin/sh is the first line: // I prefert this If #!/bin/bash is the first line: Would it be possible ...
alper's user avatar
  • 1,570
0 votes
1 answer
197 views

Try to move to eshell and I am wondering what the best solution to translating the bash functions like below to eshell? function cm-gen { cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $@ ...
Enze Chi's user avatar
  • 1,480
2 votes
2 answers
1k views

The command I'm trying to duplicate: curl https://example.com | readability https://example.com As far as I can see, though, using that | pipe is NOT the same as passing the string in as an arg. If I ...
Webdev Tory's user avatar
3 votes
2 answers
672 views

I wan't to be able to programmatically open a file in org mode and scroll to a specific header. the file is quite big, so opening the file at a certain place is qhat I am looking for. Any idea how to ...
kipkipe's user avatar
  • 143
6 votes
1 answer
3k views

When launched at system start-up, the Emacs daemon doesn't pick up modifications to the PATH introduced by shell initialization scripts. Emacswiki suggests to use this function to update Emacs' PATH, (...
Arch Stanton's user avatar
  • 1,856
7 votes
3 answers
539 views

I use noweb references inside sh code blocks, for example: #+begin_src sh echo "test" <<some-ref>> echo "test" #+end_src But this causes syntax highlighting to ...
isamert's user avatar
  • 123
0 votes
2 answers
372 views

Problem In an org file, I have a source code block containing bash code that I want to run on a remote machine: * test :PROPERTIES: :header-args:bash: :dir /ssh:[email protected]#2221: :END: #+...
kidmose's user avatar
  • 253
0 votes
0 answers
131 views

I'm running into a problem with emacs used via ssh. The problem occurs when I: Log in remotely using SSH on Konsole Run emacs -Q Invoke mouse mode with M-x xterm-mouse-mode When I click-and-drag on ...
Declan Thompson's user avatar
1 vote
0 answers
25 views

Using "set -x" in bash script, outputs each executed command to an ouput file. eg here is part of the bash script #!/usr/bin/env bash # This is called by (my) .xinitrc, xdm and _should_ be ...
RichieHH's user avatar
  • 908
1 vote
2 answers
661 views

I have been using Emacs for a while and recently started using evil mode. I exclusively use emacs-nox (command line emacs). The only thing that's missing for me is C-z to pause emacs and bring me back ...
marc.soda's user avatar
  • 133
0 votes
1 answer
638 views

Is there a reliable way to get the value of a variable defined inside an org-mode file from the UNIX shell (bash)? For example, if I have the following inside an org mode file test.org: #+NAME: foo | ...
tinlyx's user avatar
  • 1,454
2 votes
1 answer
566 views

I use Bash for my terminal on Debian. In my .bashrc, I've defined an environmental variable like so: SSH_VAULT_VM="ssh-vault" if [ "$SSH_VAULT_VM" != "" ]; then ...
GNUser's user avatar
  • 254
2 votes
1 answer
156 views

I want to use emacs as VISUAL with server-mode. As a test, I write the following in a terminal: emacsclient -F "((left . 0) (top . 0))" -c -n file This behaves exactly as expected; it ...
User12345's user avatar
  • 165
0 votes
2 answers
307 views

I have installed exec-path-from-shell as well as included the following in my init.el (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)) within my ~/.bash_profile I have ...
Tian's user avatar
  • 298
0 votes
2 answers
251 views

I have Emacs open with lots of files. I want to compile within Emacs, but first I have to source some setup.sh bash script that modifies the environment. How do I do that? This post says it's ...
Welgriv's user avatar
  • 67
0 votes
0 answers
186 views

I wrote LD_LIBRARY_PATH both in .bashrc and .bash_profile. However, if I started emacs in terminal using emacs, LD_LIBRARY_PATH is shown in getenv. If I started it using GUI, there is no such variable....
spacegoing's user avatar
1 vote
0 answers
68 views

I'm using M-x shell in Emacs and just connecting through vanilla ftp from the command line (bash). I remember (many moons ago) I came across a script for Emacs that'd keep a persistent ftp connection ...
dara's user avatar
  • 11
0 votes
1 answer
372 views

I'm trying to get Emacs to understand that my script is bash. I tried adding -*- bash -*- to the first line of the file, but it still opens in Shell-script[sh] mode. I can rename the file to give it ...
Shep's user avatar
  • 103
0 votes
2 answers
429 views

Consider a script file: ~/project/script.sh echo "arg 1 $1" echo "arg 2 $2" echo "arg 3 $3" And elisp file that invokes it using make-process: ~/project/special-mode/special-mode.el (let* ((script-...
Aaron's user avatar
  • 1
0 votes
1 answer
563 views

I'm struggling to workaround the problem discussed in this post. I'm working through the accepted solution (which also references this post, and getting what I think is close, but not quite there. The ...
HaPsantran's user avatar
2 votes
2 answers
1k views

Background: I want to use emacs like tmux which can run as persistent session as well as shorten the time for me to start bringing up emacs when I want to (as inspired by these: Emacs and a Tmux ...
menuhin's user avatar
  • 335
1 vote
0 answers
120 views

Let's say I have a bash script. Is there a way I can pass specific lines or blocks in the script to terminal process in EMACS? Just like how we do for R script using command C-c R
Veera's user avatar
  • 335
0 votes
1 answer
425 views

I am a Linux user (world was pretty neat; less to no headache)-- I've been using vim with cscope to wade through huge code-base....... And for some reason, now I have to use windows machine, here are ...
RaGa__M's user avatar
  • 101
2 votes
1 answer
2k views

What am I trying to achieve I want to use emacsclient (not emacs) as my default text editor on Debian Buster. What have I tried so far Alternatives: > sudo update-alternatives --config editor` ...
muhuk's user avatar
  • 173
7 votes
6 answers
27k views

I find running the following is different from just running emacs on mac /Applications/Emacs.app/Contents/MacOS/Emacs -nw Should I create an alias in zsh/bash for it?
eugene's user avatar
  • 539
1 vote
0 answers
128 views

I noticed that bash will correctly apply syntax highlighting inside the subshell substitution in VALUE="Hello $(echo World)." But when creating a more complicated value, e.g. VALUE="Hello $( ...
kdb's user avatar
  • 1,591
3 votes
2 answers
3k views

To reproduce my issue, open your .bashrc or a .sh file and type the following: if while echo The if has no indentation. Good. The while has the default four spaces of indentation. Good. ...
Ness's user avatar
  • 187
3 votes
1 answer
126 views

I am trying to spawn a shell outside emacs, not in a buffer. I have tried (start-process "firefox" nil "firefox"), wich does start a firefox process outside emacs, but when i tried (start-process "...
LeGLL's user avatar
  • 33
1 vote
2 answers
108 views

How can I retrieve the list of recent files in bash? I'd like to get this set of files so I can use it with rofi. I could manually parse the data file that looks something like: ;;; Automatically ...
Chris Stryczynski's user avatar