All Questions
4,556
questions
-2
votes
0
answers
35
views
How to use a large number of credentials with a bash script [closed]
I have a script that needs to store a large number of usernames and passwords. Basically what my script does is it fetches the customer usernames and passwords to execute an API link to check every ...
0
votes
0
answers
16
views
How can I save vimdiff output to a specific path in shell scripting [duplicate]
I have this shell script line to save vimdiff output in html format
vimdiff -c TOhtml -c 'w! diff.html | qa!' $INITIAL_FILE $FINAL_FILE
But this saves the file in the same directory as the shell ...
-2
votes
2
answers
103
views
Keep most common line from each set of duplicates of a column
I have a relatively complicated Bash problem. I have a two-column CSV file that contains duplicate values in the first column, as well as duplicates within those duplicate values (in the second column)...
0
votes
0
answers
40
views
Running sudo command in bash script [duplicate]
I have a db server where I am sshing into and I am running the command sudo -u oracle -H bash and I am able to validate that successfully by doing this manually but I am trying to do the same process ...
3
votes
1
answer
57
views
GNU date - parsing timezone with +HH:MM format
I'm trying to parse a date that's extracted via exiftool from the metadata of MOV files. It comes in a format of e.g. 2024:05:31 20:57:23+03:00. Even though GNU's date has the %:z option, and it is ...
0
votes
1
answer
35
views
Extract Variable Name for Unset Script
I have a .env file that contains information, to include environment variables. For example:
# comment
<mini script>
export NAME="John Doe"
export LOCATION="US"
export ...
0
votes
1
answer
50
views
Execute system commands in bash script - command not found
I have the following script:
getip.sh
#!/bin/bash
int_ip_addr=`/sbin/ifconfig pppoe0 | grep 'inet addr:' | cut -d: -f2| cut -d' ' -f1`
pb_ip_addr=`curl ipinfo.io/ip`
echo "Internal IP Address is $...
0
votes
1
answer
62
views
I can't make my shell script detect spaces and hyphens in file names
I'm a hobbyist media collector and I recently started a project of mine, being a self-hosted media server with my owned media. I've been doing everything manually for a while but started getting into ...
-1
votes
2
answers
52
views
Having trouble with my while loop being infinite for this bash script
I am just trying to prompt for the username and password and have the while loop end after three incorrect tries. I think that it has something to do with the way I incremented the count. My code ...
0
votes
0
answers
37
views
Can't echo same variable twice on one line [duplicate]
PORT=$(cat /root/EnvironmentConfigurations/mbc_back/.env | grep '^PORT=' | cut -d '=' -f 2)
echo $PORT:$PORT
OUTPUT IS-> ":6590" SHOULD BE-> "6590:6590"
I have tried to ...
2
votes
1
answer
67
views
BASH variables and curl [duplicate]
Can somebody please help me understand why the second command works as expect, but the first doesn't.
# first
SESSION=$(curl http://172.21.0.4:4444/status 2>&1 | grep sessionId | cut -d ":&...
0
votes
0
answers
19
views
Bash scripts do not function correctly in Ubuntu 24.04 [duplicate]
When I run my Bash scripts (launchpad.net/linuxha) and (launchpad.net/linuxsoho) in Ubuntu 24.04, I receive the following errors:
./LinuxHA.sh: 175: read: Illegal option -s
./LinuxHA.sh: 355: Syntax ...
0
votes
0
answers
32
views
What is the difference between shell scripting and bash scripting? (novice level answer) [duplicate]
What is the difference between shell scripting and bash scripting? I can't find any explanations at a reasonable level of familiarity to me.
I have read up on past stack overflow posts but they do not ...
0
votes
0
answers
23
views
Writing a bash script to wait for a process on a remote machine to finish [duplicate]
I'm writing a script to automate some tasks, one of the steps is to wait for a process started on a remote machine to finish execution.
My idea is to show a spinner while the process keeps executing, ...
0
votes
4
answers
58
views
How to use the output of a command as another command (nor an argument of one) in a shell script
I need to get a value from a file where it is defined as variable1=value1.
So if I do cat file | grep variable1 I get variable1=value1.
I would like to do this inside a script so that variable1 is ...