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,133
questions
0
votes
0
answers
9
views
Why timeout works differently when executed from terminal vs from a shell script file
I wanted to implement a unit testing shell script file that runs a command, compares the expected and actual output, and also add timeout constraints.
I used actual=$($cmd) to capture the stdout and ...
0
votes
0
answers
7
views
Clear not working. "clear: /usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by clear)"
clear not working in terminal. I installed homebrew in linux and uninstalled NodeJS (to install it back again using brew). However, when I was trying to check if the node package was still there, I ...
1
vote
0
answers
21
views
Docker container for apache/age image is not able to setup configuration with input redirection
I am developing a python module that uses Apache AGE and I want to do some unit testing. For this, I wrote a bash script that runs the container, copies a SQL configuration file to it, executes the ...
0
votes
2
answers
34
views
Quote URL with spaces in shell [duplicate]
I have a bash script, which I am trying to create a URL with spaces and other characters that need to be quoted. Is there a simple way to do that?
Essentially, I want to be able to write
#!/bin/sh
...
1
vote
2
answers
68
views
Is it possible to stop a pipeline when pressing a key in bash?
I am using a Rpi zero 2w and an old Rpi camera using Rpi OS (Legacy, 64-bit) Lite (i.e. a server linux) to stream a video through my local net. I want to stop the stream remotely from windows using ...
0
votes
0
answers
17
views
coinmarketcap quotes latest v2 nor return all symbol
I created a script to query the CoinMarketCap API because I need the market cap of all cryptocurrencies and the latest price. To do this, I use this API call: https://coinmarketcap.com/api/...
0
votes
2
answers
44
views
Bash child scripts - Timer interuptable by signals - read, timeout and sleep doesn't work
So, I'm on Arch Linux, running i3
I have a slideshow script that changes the background every 5 seconds. And I have a bunch of signals, such as toggle, next, previous, faster, slower. I have all of ...
0
votes
0
answers
23
views
How do you package arguments in an environment variable in bash? [duplicate]
I have an example bash script, example.sh that looks like this:
arg1=${1:-"one"}
arg2=${2:-"two"}
echo "Arg1: ${arg1}, Arg2: ${arg2}"
if I execute the command:
example....
1
vote
1
answer
33
views
Python Not Recognized in Scripts Executed via Cron
Summary
I'm obtaining an error when running a bash script via cron. The script errors out when it reaches the following command; keep in mind that the bash script swaps out ${END_DATE} with the date ...
-1
votes
0
answers
30
views
FZF only finding one single file [closed]
Using fzf in my home directory in kali only shows a file in the bin directory, without showing any other file. It works the same using the telescope plugin in nvim, showing the same file. But if i ...
2
votes
5
answers
71
views
How to insert a character in front of a line one line above a specific character?
In my text file there are many lines whose contents are almost the same. Here are some of them.
So, what I want is to overwrite the / with - on every line and then insert - in front of the line ...
-1
votes
0
answers
38
views
need a bash script to list all jobs in jenkins under my username or in folder [closed]
I'm on enterprise version and using a windows machine.
keep it basic jq is not installed
in parameters
JENKINS_URL="https://xxx/xx/xx" in google people are using something with /8080 i'm not ...
0
votes
2
answers
68
views
Bash: Reading in a string from a file with variable substitution
I have a weird situation where I have a command stored in a file and that file contains references to variables.
I'm able to read the file just fine, but I'm having trouble getting variable expansion ...
0
votes
0
answers
32
views
For loop of bash script not working, reading lthe next lines within the previous loop [duplicate]
I cannot solve the for loop error in bash script.
The bash script is for extracting data from remote server, copying mapped files locally, and then executing a tcl script.
The above process should ...
0
votes
0
answers
15
views
Termux: Permission Denied Creating Directory (gpg Key)"
I'm having trouble updating packages in Termux due to a permission error when trying to create a directory for the GPG key.
Attempting to search for packages with pkg search jed results in an error ...