Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-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 ...
AnonymousDev's user avatar
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 ...
Nandana's user avatar
  • 11
-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)...
Hashim Aziz's user avatar
  • 5,198
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 ...
kancharla chandra's user avatar
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 ...
Mirek's user avatar
  • 397
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 ...
w113msh's user avatar
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 $...
Freaky's user avatar
  • 1
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 ...
Nescada's user avatar
-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 ...
Thomas Dunn's user avatar
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 ...
Niko's user avatar
  • 1
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 ":&...
sven's user avatar
  • 23
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 ...
tlbean's user avatar
  • 13
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 ...
bubbles's user avatar
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, ...
Trilok Bhattacharya's user avatar
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 ...
Louis Nichols's user avatar

15 30 50 per page
1
2 3 4 5
304