Unanswered Questions
4,451 questions with no upvoted or accepted answers
18
votes
2
answers
4k
views
zsh can't input to terminal when piping stdin and stdout with variable command that has tty output
System info:
macOS Sierra 10.12.6
zsh 5.4.2 (x86_64-apple-darwin16.7.0)
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)
Scroll to the EXAMPLES at the bottom if you just want to dig in ...
9
votes
1
answer
557
views
Colorize the command trace as well as the PS4 prompt
With the option set -x, each command is echoed to STDERR before execution, prefixed by the expanded $PS4, with the first character being repeated according to the call stack depth.
I want the output ...
9
votes
2
answers
669
views
What is the historical reason for using curly braces {} as placeholder in find -exec
Everyone knows find . -exec foo {} \; and at some point stopped thinking about it. But recently I came back to the question that arose when I first learned it:
Why would anyone choose {} as the ...
7
votes
1
answer
2k
views
Moving cursor to end of line when using history-search-backward
I recently added the following lines to my .inputrc:
"\e[A": history-search-backward
"\e[B": history-search-forward
However, I noticed when using this that my cursor does not jump ...
7
votes
1
answer
2k
views
bash/gnu readline multiline command: move row up/down
How to move one editing row up (back) or down (forward) in a multi-line command in bash/readline?
Somethnig like gj/gk in Vim.
6
votes
0
answers
415
views
Bash completion own compgen prefix
I have a simple bash completion script that essentially invokes my (non-bash) program and set its output to COMREPLY, i.e.
COMPREPLY=( $(my-program -- "${COMP_WORDS[@]}") )
Some of the options accept ...
6
votes
0
answers
2k
views
Execute script on external keyboard connection
EDIT: This is NOT a duplicate because the linked question is about external USB drives, not keyboards. The suggested command udevadm info -a -n sdb does nothing in helping to find the corresponding ...
5
votes
0
answers
109
views
Subsequent "git clone" commands influencing each other?
I'm currently part of a migration from GitLab to Azure DevOps. As part of that I wrote a little bash script that iterates over the migrated git repos and for each performs a clone from both gitlab and ...
5
votes
1
answer
607
views
Why does bash print exit even when it does not exit - is this a bug?
exit with zero or one numeric argument like exit or exit 42 print "exit" and exit the shell.
exit with an invalid argument like exit hello prints an error message, prints "exit" ...
5
votes
0
answers
2k
views
How to have the results of an `fzf` selection enter my bash history?
FZF is a lovely tool, the main issue I have is that the commands I end up running with it don't end up in my bash history.
Let's say I do this
history | fzf
And I choose a command I ran recently, say ...
5
votes
0
answers
1k
views
Kernel module remove not permitted for some sudo users
I use a sudoers file, which (besides other items) contains following lines:
homebridge ALL=(ALL) NOPASSWD: /sbin/modprobe -r bcm2835-v4l2, /sbin/modprobe bcm2835-v4l2, /sbin/reboot
%sudo ...
5
votes
1
answer
1k
views
wget exit code with -nc
If I try downloading a file which already exists with wget using the --no-clobber option, it works as expected but the exit code is 1 which is crashing my scripts. Why is the exit code 1 and how can I ...
5
votes
1
answer
700
views
bash + how to avoiding duplicate entries in authorized_keys (ssh) in bash
Popular methods of adding an ssh public key to a remote host’s authorized_keys file include using the ssh-copy-id command, and using bash operators such as >> to append to the file.
An issue ...
5
votes
0
answers
626
views
Is there a command like `time` that monitors the network traffic of commands?
I can use the time command to measure the time some command takes:
time node -e ""
node -e "" 0.06s user 0.01s system 92% cpu 0.076 total
Is there a similar way to measure a ...
5
votes
0
answers
250
views
On MacOS, what character does `Esc+` or `+Esc` correspond to in Bash, when using iTerm2 terminal?
I've read that mapping Left Option key to Esc+ should fix many of the issues users of Bash, on MacOS, have with GNU Readline key-bindings.
However, I've never encountered Esc+ or +Esc before, so does ...