92,942 questions
-4
votes
0
answers
76
views
cat command stuck waiting for an EOF in pipeline [closed]
I am developing a shell in C++. After implementing pipes, I have noticed a problem. When running background commands like echo hello | cat &, I get hangs. Why is that?
Here is my implementation ...
Advice
0
votes
1
replies
42
views
Is a fish shell variable just a string separated with spaces?
The docs say that all variables are lists, and I thought that meant they had some special internal structure that was outside the scope of the shell interface. Like, how the , in the python list [1,2,...
0
votes
0
answers
76
views
In shell pipes, maintaing resilience against orphaned process and buggy applications [duplicate]
Note: The question is not a duplicate of Getting ssh to execute a command in the background on target machine. The other question relates to background processes that may be sent the hangup signal.
...
1
vote
1
answer
101
views
Permission denied when running executable with systemd [closed]
On my Raspberry Pi 5 (64 bit) I'm trying to run a command via a python script, using systemd to start it at boot. The chain goes like this:
ids.service in /etc/systemd/system/:
[Unit]
Description=IDs
...
1
vote
1
answer
88
views
tput command will fail when redirecting stderr to /dev/null inside a command substitution
Running tput cols inside a command substitution, while redirecting stderr always make it fallback to 80.
Unless I redirect it to a terminal device file
tput cols # Output: actual ...
2
votes
2
answers
172
views
Why does this function see only 2 values when I send an associative array and 3 values when I send a normal array?
This is my function
#!/usr/bin/env bash
function run_aws_ssm_delete_parameters() {
local -r enable_logging="$1"
local -n parameter_names="$2"
shift 2
local -a ...
3
votes
1
answer
113
views
How to properly quote associate array subscripts in Bash?
If I declare an associative array in Bash, and then want to reference an element using a subscript which is a variable whose value contains spaces, when and how should I quote the variable name I am ...
2
votes
0
answers
94
views
How to include feature of using arrows to navigate through previous commands [closed]
I am making a shell orchestrator in C which connects with other devices and controls connected systems using an IP address. I am having difficulty in adding the feature to use arrow keys to navigate ...
Advice
0
votes
9
replies
57
views
Most efficient way to determine if a file exists only with a given extension
I have a little problem to crack that turns out to be less trivial than I thought - even to formulate as a question for the title of this ticket, in fact!
Here's the background: I mount my iPhone via ...
3
votes
1
answer
110
views
Receive "Error reading input file" when running password decryption in BASH
When working on a BASH exercise that is about building a simple password and account manager, I am required to add the function that allows users to retrieve an encrypted password. Below are my codes:
...
4
votes
1
answer
82
views
time shell keyword not respecting value of TIMEFORMAT when set before command
According to the Bash manual,
The TIMEFORMAT variable may be used to specify the format of the time information.
For instance, if I set TIMEFORMAT to %R, then time should only print the elapsed time ...
1
vote
1
answer
119
views
chdir syscall doesnt change my current directory
I am trying to implement a small Shell in C, one of the builtins required by my school project is cd. To do it, I use chdir to get a grip on some basics directory movement.
I have read the man of cd ...
Advice
0
votes
1
replies
49
views
How to design a database schema for managing hospital medical equipment inventory?
I’m working on a small project to build an inventory management system for hospitals that keeps track of medical equipment and supplies. The goal is to manage different types of equipment, track stock ...
0
votes
1
answer
50
views
Handle leak when using WScript.Shell / FileSystemObject via COM automation (Windows Server 2022)
I am investigating a possible handle leak related to Windows COM objects used from a third-party application.
The application (Elipse E3 SCADA) runs VBScript code that instantiates Windows COM objects,...
0
votes
0
answers
52
views
Check if shell script/function is being piped into without false positives [duplicate]
I've searched around about how one can write a shell script (preferably cross-shell, but also in bash) that detects if it is being piped into so that it's operation can be changed accordingly. The ...