Questions tagged [bash]

BASH is the GNU Bourne Again SHell, the successor to the classic Unix Bourne sh (shell). It's the default shell for various Linux/GNU systems.

About Bash

There are a variety of interpreters that receive commands either interactively or as a sequence of commands from a file. The Bourne-again shell (Bash) is one such interpreter. Bash implements the standard Bourne Shell (sh), and offers numerous additions.

From the Free Software Foundation's Bash page:

Bash is an sh-compatible shell that incorporates useful features from the KornShell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.

Read the Bash manual for technical details.

Books and Resources

Additional reading materials include:

101 questions
13
votes
2 answers

How to run the history search in Vi mode in bash

I want to find the alternative to ctrl+R to search history in bash. I can enable vi mode in bash but I cannot make it search. When I do /search or ?search nothing happens. Is there something more I should press? I tried press enter and then this…
Niklas Rosencrantz
  • 179
  • 1
  • 1
  • 10
11
votes
5 answers

How to output result of vim commands to shell

Let's say I'm in the shell (bash) and want to see output that :scriptnames would give, but don't want to start vim or maybe I want to echo that into another file. So I execute vim +scriptnames Which shows me all the scripts, but how do I echo that…
hgiesel
  • 1,944
  • 2
  • 16
  • 25
7
votes
1 answer

How do I turn off the "feature" where the pound sign "#" is forced to 0 position?

When writing C/C++ code, vim defaults to forcing any pound sign ("#") to the zero position column. This is fine for for C/C++, but it is very annoying for shell scripting and perl scripting, since the pound sign is used for comments. For example, if…
Doug Barbieri
  • 173
  • 1
  • 7
7
votes
3 answers

vi editing of bash command line: Avoid execution upon exit?

I'm running bash, and my ~/.inputrc contains set editing-mode vi. This allows me to edit my command line using vi-like behaviour. And I can press v in normal mode to enter the full-fledged vi-editor, if I need full power to edit the command. The…
user36800
  • 443
  • 3
  • 10
5
votes
2 answers

Vim won't return to foreground

I had vim open in a terminal; I needed to check some other things so I typed Ctrl-Z. When I later type fg, it just stopped again: myprompt$ fg vim newfile path/to/existingfile [1]+ Stopped vim newfile path/to/existingfile [1]+ …
Wildcard
  • 4,409
  • 26
  • 49
5
votes
0 answers

real time vim keylogger

is there anyway to log vim keypresses (or keypresses in general activated by vim) and record it somewhere (STDOUT, file, etc) in real time? I want somthing similar to vim -w file.log file and this question, but in real-time (within 5 seconds…
user7903682
  • 151
  • 1
3
votes
1 answer

Why is bash not interactive after setting &shell='/bin/bash -i'?

My vimrc sets the shell option: let &shell='/bin/bash -i' which I confirm using echo &shell The -i makes the shell interactive. I want to do this so that it runs ~/.bashrc, which contains the setting shopt -s extglob However, extglob was not…
user2153235
  • 905
  • 5
  • 14
3
votes
1 answer

Strange shell (bash) behavior when started from vim

Edit: Solved. See GitHub: amix/vimrc#204. I often drop a shell out of my vim window by :!bash but I have two problems with it. I can't use UTF8 for pipes with QWERTZ layout, I can't use Umlaut keys like öäü, i.e. ö behaves like ALT-_ I think the…
criztovyl
  • 151
  • 6
3
votes
2 answers

Error when opening shell scripts

I began to get the error Error detected while processing BufRead Auto commands for "*.sh": E117: Unknown function: dist#ft#SetFileTypeSH when I opened shell scripts (*.sh) I think it happened after updating from a 7.x version to 8.0. How can it be…
ka3ak
  • 261
  • 2
  • 10
2
votes
0 answers

Vim: error opening files 62_InitializePythonBuiltin the Python's site module could not be loaded

I have set up vim on a new machine according to Vimlander-2-The-Quickening, but I keep running into the following errors when I open a file in command mode: :e /path/to/file, :vs /path/to/file, or :sp /path/to/file. Does anyone recognize these…
robskrob
  • 153
  • 1
  • 5
0
votes
1 answer

Which linux commands are native to Vim?

You can execute commands from vim like this: :!cp However, the command is executed externally. The above can save typing and effort, but which are the commands that don't require the "!". Here are the only two I have found: :cd…
user8919
0
votes
0 answers

How do I open up a new interactive shell from the command line?

When I run this command from the command line: taskopen -A c6cb317e It opens an interactive menu for choosing a file. After making a selection, it then opens a file in vim for editing, or, if the selection isn't a text fie, it will open it with an…
StevieD
  • 1,492
  • 1
  • 16
  • 24
0
votes
2 answers

Why all lines dispear after executing the lines on edited file?

vim command.txt key="123456" openssl enc -des3 -a -salt -in /tmp/test -k ${key} -out /tmp/test.asc In vim's command mode :1,2!bash,the file /tmp/test was encrypted into /tmp/test.asc ,but all the lines in command.txt dispear,where is my lines in…
showkey
  • 1,130
  • 2
  • 11
  • 30
0
votes
1 answer

Process substitution with read

I want to print stuff to the screen separated by key presses (any key). A reduced version of what I'm trying to do is: $ echo banana && read -rsn1 && echo orange && read -rsn1 && echo apple That works fine in bash, as expected. However, I would…
faviouz