Questions tagged [bash]
**** IMPORTANT NOTE: Do not ask a bash question until after you have copy/pasted your script into http://shellcheck.net and fixed all of the issues it tells you about. **** This tag is for questions about scripts written for the Bash command shell. Questions about the interactive use of Bash are more likely to be on-topic on Unix & Linux Stack Exchange or Super User than on Stack Overflow.
156,201
questions
0
votes
0
answers
12
views
Apple hardware modules in directory other than that used by Linux kernel for startup modules [closed]
I recently installed Linux on a 2019 MacbookPro and do not have the ability to use the laptop trackpad or keyboard, nor to connect to a WiFi network.
I am wondering, is my path to the startup modules ...
1
vote
1
answer
40
views
for j in os.system("ls *.out") Doesn't iterate. Changing the name of files depending on extension [duplicate]
I am trying to write a script that will help me run a model several times changing the input of one value of the input files. The model over writes the output files so I need to rename the outputs ...
0
votes
0
answers
24
views
Github CLI: repo counts without details
The --limit option of gh has an upper value limit. This is set to reasonable values, and for understandable reasons; as discussed here.
It can be convenient to format the output of gh as JSON, and ...
-1
votes
0
answers
37
views
Is measuring CPU time wrong in this (parallel) situation? [closed]
I'm running some graph algorithms that take a long time to run, so I need to set a timelimit to ensure it doesn't run for weeks. I have a 12 core CPU and 24 graphs to run the algorithm, so I set the ...
0
votes
0
answers
13
views
Jenkins doesn't receive correct code from sh script out of podman container
I have a Jenkins pipeline where I run tests in a container and the tests are triggered by .sh script.
There is an intermittent problem when script returns exit code 1, but some how Jenkins stage ...
1
vote
0
answers
39
views
Сreating multilevel json with the jq utility in a bash script
I get the contents of a text file into an array and then sequentially get the elements of the array and try to add the elements to the json:
#!/bin/bash
JSON=$(jq -n '')
readarray -t array < ./...
0
votes
0
answers
36
views
Shell script to add and commit in batch of files at a time [closed]
I will like to fix the issue where "git add" fails when a space is detected in the path file name. e.g source/code/data form/documents.txt. How can I update this script to allow file names ...
-1
votes
0
answers
27
views
Bash Regex Start Anchor w/Character Classes Not Working [closed]
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
$> var=39Q08a
...
-1
votes
0
answers
35
views
apk not found/ apk doesn't exist - System App on Anbox Cloud Appliance
I'm trying to install an app as system app in anbox cloud appliance however it keeps giving me this error: "APK not found..." or it says "APK doesn't exist" with the given address. ...
-2
votes
4
answers
98
views
How to append some static content within a single cell of an existing CSV file
Let's assume I need to append the below content within the first cell (not be row by row) of the existing CSV file which has details of the customer. How can I achieve it?
Content to be added:
"...
-2
votes
0
answers
22
views
Get only value from influxdb query table result in bash variable [closed]
I am executing a CLI flux query with a bash script.
This is the flux query:
from(bucket:"my_bucket") |> range(start:-365d, stop:now()) |> filter(fn: (r) => r._measurement == "...
0
votes
0
answers
27
views
Run certbot on centralised server to generate certificates manually [closed]
Overview:-
Developed a centealized custom api (.net) and deployed to nginx server to accept api request for generating a ssl certificate through api calls.
when a new request api call is made , I’m ...
1
vote
0
answers
69
views
exit status of if statement in bash when condition is false
If I run help if in bash then it tells me that the exit status is "the status of the last command executed". Let's try it:
if false; then
echo we never get here
fi
echo $?
The last ...
2
votes
3
answers
70
views
Using sed to remove differences in two arrays (updated ssh keys)
My aim is to updated automate the update of ssh keys in the authorized_keys file. Due to restrictions i am unable to use ansible which would have been a lot simpler.
Steps:
read keys from the file
...
0
votes
0
answers
27
views
Websphere Automation [closed]
I have a script which references a txt such as serverList.txt which has a list of linux servers where WAS is running and stops the nodeagent on them.
I'd like to add to the script where it stops the ...