Questions tagged [shell]
A shell is software that lets users interact with the operating system, usually by typing at a command-line.
879 questions with no upvoted or accepted answers
14
votes
1
answer
2k
views
Trap on DEBUG signal for the dash shell?
With the bash shell, you can install a trap on the synthetic DEBUG signal. This is useful and will execute your function or bit of code on every shell command. For example:
$ trap 'logger -t shell "${...
9
votes
1
answer
2k
views
Shell unbuffering for CygWin: is it possible?
I have tested on CygWin doing "ls -R" with a large directory and sending the output to a Test.txt file, so the process takes about 30 seconds to complete; the file is created, but it is empty; it will ...
6
votes
0
answers
2k
views
compgen on zsh returns a different result than on bash
I am trying to make bash completions work properly in zsh.
I am aware of the need to load these in ~/.zshrc:
autoload -Uz +X compinit && compinit
autoload -Uz +X bashcompinit && ...
6
votes
0
answers
2k
views
Change the working directory in registry shell open command
I need to register an application to a URI scheme and I want the application to run from different working directory, but I couldn't find a way to change the working directory directly in shell open ...
6
votes
0
answers
753
views
When using shell inside Docker, previous command (Ctrl+P) does not refresh
I'm new to Docker, and I had a running container with Ubuntu 16.
I usually connect the container with the command:
docker exec -it 7e3 /usr/bin/zsh
Then, when I use the shell inside the Docker,
when ...
5
votes
1
answer
190
views
Byobu: Save context for each window
I use Byobu with zsh when working on my research. I have many windows open, and often each of them is running a different experiment. When I run an experiment, the experiment executable creates a new ...
5
votes
0
answers
25k
views
How do I format disk from UEFI shell?
I need to format 2 disks from pre-built UEFI shell.
So I have 2 questions.
How do I format a disk from UEFI Shell?
How do I know what is the disk name or label?
By the way, in the first question I ...
5
votes
0
answers
3k
views
Make cmd.exe exit on any error in a batch file
On Unix shells, such as sh or bash, there is a -e flag that causes it to stop executing a script as soon as a command encounters an error.
Is there any equivalent for Windows CMD.EXE?
If not, why not ...
5
votes
0
answers
786
views
Configuring Heartbeat to run shell script
I set up a high availability system with Heartbeat, I wish that when there was a drop in the main cluster and the secondary cluster was activated, Heartbeat start in it and execute a shell script.
...
5
votes
1
answer
246
views
Ssh X11 forwarding messes up with default shell
I have a bash specific code in my bash profile:
$ cat ~/.bash_profile
#!/usr/bin/env bash
echo "SHELL: $SHELL"
function printfiles() {
while IFS='' read -r _file || [[ -n "$_file" ]]; do
echo ...
5
votes
1
answer
2k
views
How to open a local file with a query string appended to it in the default browser?
I want to do something like this from a shell script:
$ open 'foo.html?foo=bar'
Sadly that fails, as it looks for a file named foo.html?foo=bar instead of foo.html before opening the browser:
The ...
5
votes
3
answers
4k
views
Windows Explorer: Customize view settings via batch or shell-extension?
In folders with shortcuts (and junctions) I oftenly like to have mid-sized icons, sorted names and grouping by type. Alas, Explorer oftenly forgets these settings once I made them manually.
The ...
5
votes
2
answers
1k
views
Shell commands as background image
In many terminals and terminal emulators, it is possible to specify a background image. I've seen some setups where-in this background image was even dynamic. Is it possible to watch a preset command ...
5
votes
1
answer
10k
views
Close a specific Chrome tab in Ubuntu/Linux using terminal command
Is there a way to close a specific Chrome tab with a terminal command? I tried below commands:
kill -9 <pid of Chrome tab>: Instead of closing a tab, it kills the tab ("He's dead Jim" message ...
4
votes
2
answers
5k
views
Is it possible to have dropdown autocomplete select options in ZSH or Bash?
Is it possible to have dropdown autocomplete select options in the terminal with ZSH or Bash as shown in the image below? Here the regions(i.e. ap-northeast-1, ap-northeast-1 etc) are predefined