Questions tagged [bash]
Bash is a free shell for Unix-like operating systems from the GNU Project.
11,951 questions
10
votes
2
answers
728
views
Why doesn’t Bash in macOS accept non-ASCII key presses?
Brand new macOS Tahoe install. I installed bash with Homebrew to get a newer version, 5.3.9(1)-release.
In Terminal, Swedish and other non-ASCII characters like å, ä, ö work fine in Zsh, but in Bash I ...
1
vote
0
answers
60
views
Why does source env.sh fail with $'\r' after dos2unix control.sh, but work after Vim :set ff=unix?
Environment: Linux, Bash, scripts created on Windows (CRLF).
I have two shell scripts:
control.sh - Main script that sources env.sh
env.sh - Environment variable configuration file
Both scripts were ...
0
votes
1
answer
92
views
Bash: Notification When a Background Job Changes State
After running into an issue (I pressed Ctrl+Z instead of Shift+Z in a terminal), I’m currently reading the section of the Bash manual dedicated to background jobs. There’s a sentence there that I’m ...
1
vote
2
answers
2k
views
Why does searching an email address via grep on this site not give any results?
Consider https://www.trumpingtoncc.org.uk/. On a large-enough screen, you can see the email address shown to the right, like this
And if I inspect the page, I can see the piece of HTML content ...
3
votes
0
answers
97
views
Why does a Taskwarrior run by cron result in this issue? All works perfectly when run manually
I have a script that goes like this:
#!/bin/bash
# https://stackoverflow.com/a/821419
set -Eeuo pipefail
_SUBJECT='Taskwarrior ghistory.daily'
_TO='[email protected]'
_TMP2=$(mktemp /tmp/tmp.XXXXXXXXXX.log)
...
-1
votes
2
answers
144
views
Why doesn’t “kitty confirm_os_window_close -1” work as expected? It still prompts for confirmation when closing on macOS
My kitty terminal asks for confirmation when closing terminal windows even though I set it to:
confirm_os_window_close -1
My expectation is that there's no confirmation prompt if there are no active ...
4
votes
1
answer
61
views
Why does `( cmd )` and `( cmd ) || ( foo )` catch errors differently in `cmd`?
I am trying to run a list of commands, stop on the first error (non-zero return code) and run some error handling if this happens.
My current solution:
set -e
set -o pipefail
(
cmd1
cmd2
...
)
...
1
vote
0
answers
79
views
'history -d linenumber' does not delete the numbered item
I am using bash, on Ubuntu 18.04, kernel version 5.4.0-150-generic. To delete history item 83838, I type
history -d 83838
but nothing seems to happen. It is still there when I enter history again.
If ...
0
votes
1
answer
72
views
Escaping the space in the ssh-agent SSH_AUTH_SOCK path
This is with Git for Windows 2.53.0 x64 on Windows 11 Home.
When I run
eval "$(ssh-agent -s)"
I get an error of the form:
bash: <LAST NAME>/.ssh/agent/s.<random characters>....
0
votes
1
answer
53
views
How to execute a constructed command?
Because of "reasons", I have to sort the outputs of some post-processed files. I don't know how many files there are in advance, so I have to iteratively construct the final command line.
...
3
votes
3
answers
1k
views
How can I send data (not commands) over SSH? [closed]
Everyone knows that you could do telnet towel.blinkenlights.nl to watch Star Wars in your terminal. You can also connect to IRC using Telnet, because it's not confined to connecting to a shell.
On SSH,...
0
votes
0
answers
38
views
Initialize a GNU screen session with multiple split panes using a bash script
I want to script the creation of a gnu-screen session in order to start it quickly on an Ubuntu server because I'm lazy when it comes to opening screen panes.
Let's work with this rather simple screen ...
-2
votes
1
answer
43
views
How use vim substitute() to strip non-alphabetics from either end of a word
Using vim 9.1 on Lubuntu 24.04
Suppose @" contains " Jcouldn't, ". I have tried a variety of regexes to reduce @" to Jcouldn't, including
echo substitute(@","^\A*\(\u\l\+'...
3
votes
1
answer
512
views
How can get SFTP commands return codes?
I have my SSH key loaded, and I'm trying to get an SFTP command (ls -l for example) return code:
$ echo ls -l dummyFile | sftp user@server
Connected to server.
sftp> ls -l dummyFile
Can't ls: "...
3
votes
2
answers
721
views
How to use an app from Microsoft Store as Git editor?
I use Windows 11. Some weeks ago I had installed Kate via the Microsoft Store. Then I configured it as editor for Git, by editing my .gitconfig file and adding (in section [core]) this line:
editor = \...