156,881 questions
0 votes
0 answers
28 views
git-bash gettext wrong encoding
I'm trying to translate my bash scripts using the gettext tools but I have a problem where the encoding seems to be wrong. Let's say I have the following file called fr.po: # French translations for ...
0 votes
1 answer
79 views
Fortran90 doesn't compile with gfortran
I am attempting to compile and run a Fortran 90 program using command line (bash). In the past, when I've run gfortran /path/to/file, a file a.out and a file program_name are created, and I can run ...
Best practices
0 votes
0 replies
36 views
When packaging a bash binary produced by Bazel, do I need to keep the rlocation/data location boilerplate?
I was trying to exercise with Bazel by packaging a deb package from a collection of scripts I'm writing to automate a few tasks at work. Right now, I keep them either in /usr/local/bin or \~/.local/...
Best practices
0 votes
1 replies
29 views
Best way to check for empty secret/variables in GitHub workflows
We've had troubes in the past trying to validate github environment against unset/empty secrets or variables. I've used bash scripts like [ -z "${{ secrets.mysecret }}" ] && exit 1; ...
1 vote
0 answers
70 views
Prevent TMUX exit on PTY OOM kill?
I have a high memory program (ML) that I want to run in a tmux session. However, if the process is OOM killed, the tmux session is also shut down. I partially solved it (using the below run-bg), but ...
Best practices
0 votes
7 replies
106 views
Does Bash support local variables in POSIX mode?
Does Bash support local variables in POSIX mode? x=42 echo $x foo() { local x=43 echo $x } foo echo $x $ /bin/bash4 script 42 43 42 $ /bin/bash4 --posix script ?
-3 votes
0 answers
44 views
Error trying to get access token for system-assigned managed identity at particular instance else working fine
Encountering an issue where the access token is not generated at the intended instance when using a Linux VM with system-assigned managed identity to retrieve secrets from Azure Key Vault. This issue ...
2 votes
6 answers
388 views
Slow bash script using shuf. Alternative to shuf for better performance or poorly written script?
My goal is to get a certain number of values between 1 and 50, a certain amount of times. It has to be randomly selected in [1-50] interval. I wrote this script but it runs awefully slow. I removed a ...
4 votes
4 answers
112 views
Map unknown associative array element
How can I map an unknown value alongside other known values in bash using an associative array, so that: #!/bin/bash array=("foo" "foo" "bar" "something else" &...
2 votes
4 answers
128 views
Is it the tty, the shell, or both that is responsible for echo-ing user input?
I seem to be observing conflicting evidence regarding how the tty and the shell share responsibility for displaying user input. In the following interactive session, user input is no longer echoed to ...
0 votes
2 answers
34 views
Git Bash can't recognize flutterfire command on Windows OS
I have installed Firebase CLI on my Windows OS machine, I have activated FlutterFire CLI, and have added Dart’s global bin to my system PATH But when I run flutterfire --version command in my bash ...
2 votes
1 answer
42 views
terminals don't open in the new workspace, instead open in current workspace | i3 window tiling [closed]
i create a script that is supposed to create a new workspace and that workspace launch four terminal each in given position with a command ran in it. this is the script.sh #!/usr/bin/env bash WS='9:...
2 votes
1 answer
84 views
How can I capture the output of a subprocess (deno) called from a bash script when run by CRON?
I have a bash script that turns off stdout and stderr when not run interactively (i.e. run from CRON). if [[ ! -t 0 && ! -t 1 ]]; then #echo "The script is not called ...
1 vote
1 answer
60 views
How do I feed stdin to an expect script to spawns a shell and collect stdout?
Consider the following expect and bash scripts: spawn-bash.exp #!/usr/bin/env expect spawn bash stty raw -echo log_user 0 remove_nulls 0 expect { -i $spawn_id "?" { send_user -- [...
1 vote
1 answer
76 views
YQ: load a text file as array and use it for an operation
I have a yaml file with an arbitrary amount of documents, and I'm trying to replace all missing namespaces for namespaceable resources with an arbitrary input one. Getting the non-namespaceable ...