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.
107 questions
0 votes
0 answers
139 views
How to change LSP configurable options with Eglot?
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 ...
0 votes
1 answer
48 views
Bash sequence expression not expanded in org-babel session
Why are bash sequence expressions expanded in a normal org-babel source block but not in one attached to a session? #+begin_src bash ...
0 votes
1 answer
143 views
Run code-blocks output format - conda environment
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 ...
0 votes
0 answers
87 views
bash colors in emacs
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;...
1 vote
2 answers
963 views
How to tangle code blocks from an org file, compile the output, and open the result, with a single command?
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 ...
0 votes
0 answers
121 views
Executing highlighted code snippet
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 ...
1 vote
1 answer
78 views
How to print bash results properly?
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 │ │ ├── ...
0 votes
0 answers
111 views
How to stop screen from changing how emacs handles colors
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 ...
0 votes
1 answer
48 views
How to define a function to add the text "hello world\n" at the current buffer's cursor? [duplicate]
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 ...
0 votes
2 answers
3k views
How do I use Emacs editor in Git Bash terminal on a Windows machine?
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 ...
0 votes
1 answer
125 views
org-babel Bash Results in RESULTS
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 ...
0 votes
0 answers
100 views
bash script fail execute in org-babel block
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....
0 votes
1 answer
111 views
How can I suppress specific flycheck messages in sh-mode?
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) ...
1 vote
1 answer
63 views
Why does the same code called first by bash and then by emacs not behave the same way?
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 ...
1 vote
1 answer
2k views
How to run yarn in a bash script from emacs?
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&...