Questions tagged [shell]
A shell is software that lets users interact with the operating system, usually by typing at a command-line.
4,120 questions
3
votes
1
answer
199
views
How to run shell commands via stdin?
I was working with a command like this:
ssh another_host <<EOF
set -x
command_a
command_b
run_framework
command_c
...
EOF
The odd thing was that only commands up to and including run_framework ...
2
votes
1
answer
173
views
How to get a list of existing files from a list of files?
I have a list of files (builddir/foo.s builddir/foo.i builddir/foo.ii) that happens to come from brace expansion of builddir/foo.{s,i{,i}} . I would like to symlink them into the current directory ...
2
votes
2
answers
76
views
How can I use Awk to match multiple lines and then concatenate other fields?
How can I use Awk to match multiple lines and then concatenate other fields?
1 Gen 1 75
1 Gen 1:1 10
1 Gen 1:1 11
2 Exo 1:1-2 13
2 Exo 1:1-2 14
3 Num 1:1-4 ...
0
votes
1
answer
136
views
Why doesn’t my sed command work properly? It replaces old values with errors
The sed command that I use is:
sed -i 's,oldvalue,newvalue,g' *.txt
When I use the above sed command with each of the below examples (1, 2, and 3), the results contain errors.
Example 1
Old value:
...
0
votes
0
answers
111
views
macOS VSCode Shell Command Error - "Unable to install the shell command '/usr/local/bin/code'."
I’ve recently installed VSCode on macOS Ventura 13.7.8 and I’m getting the error message "Unable to install the shell command '/usr/local/bin/code'." when I try to install ‘code’ command in ...
2
votes
1
answer
93
views
Why does `bind -x` with Ctrl+O stop working after dropping to shell from `vifm` in Kitty terminal?
bind -x '"\C-o":vifm'
This opens vifm but then when I drop down to the shell by pressing o on my keyboard triggering nnoremap o :shell<CR>, I am not able to use the ctrl + o keyboard ...
0
votes
0
answers
91
views
Can the fish shell also concatenate aliases that are input as arguments of doas and sudo?
Can fish run aliases input as arguments of sudo and/or doas?
What I have read thus far:
✅ Analogous feature for 'bash'. Dziȩki, @Kamil Macorowski
Aliases on fish
Related NixOS post
3
votes
1
answer
290
views
Systemd: How to unpack %I arguments to ExecStart without wrapping in Shell?
I have a systemd service like this, where the executable takes multiple arguments (with "-" flags and values).
pairman@revyos-lpi4a:~/.config/quasar/quasar-server$ cat ~/.config/systemd/user/...
2
votes
1
answer
360
views
How to directly reboot into the EFI GUI via an EFI shell? [duplicate]
Rationale
When working in an EFI shell, I frequently want to reboot directly into the firmware GUI, so that I can modify a preference. Rebooting the machine the regular way, then either mashing a key, ...
-3
votes
1
answer
92
views
bc command results are not what are expected when changing from ibase to obase
I am trying to convert non-base 10 (non-decimal) numbers to each other by using bc command in Linux, but the answers are different from what I expected.
ibase = 3
obase = 7
23
11
Why is the answer 11?...
2
votes
2
answers
322
views
How to reuse the content of file descriptor more than once?
Working with big ASCII files that I keep compressed on disk. (ie, bigfile.json.gz)
Clever me thought "Hey, let's use process substitution to work with the uncompressed content of the file."
...
2
votes
0
answers
66
views
After killing python3 in subshell with `Ctrl+\`, bash stops echoing prompts
I save this shell script as test.sh and then run bash test.sh:
python3
When the prompt appears I press Ctrl+\ (in reality I have more complicated Python commands and Ctrl+C/Ctrl+D doesn't work). ...
13
votes
1
answer
2k
views
Is there any scenario where using cat speeds things up?
In Useless use of cat? it is established that, generally speaking, using cat in a shell pipeline with a single argument at the beginning of a pipeline reduces its performance.
Does there exist a ...
0
votes
1
answer
73
views
shell loads an empty variable by using source
In a shell script:
source ENV
echo $ENV_HOST
echo $ENV_GRPID
...
in ENV file:
ENV_GRPID=mygroupid
ENV_APPID=myappid
ENV_LOGID=a_log_id
ENV_H0ST=myhost
ENV_PORT=9091
however, using bash -x ...
0
votes
0
answers
145
views
How to access the motherboard firmware storage via an EFI shell?
I want to better-understand how such software is structured, when deployed to a device.
I own a LINX1010 with an included-by-default EFI shell. It persists when no OS is installed on the internal ...