Category "bash"

How to add a PWD in to .env

Is there anyway to use pwd or $PWD in .env. Im looking to get the PWD so that I can add it to an PYTHONPATH env. Thanks,

Bash IF condition with multiple conditions not giving proper result

Trying to fetch the status of the URL for sonarqube quality gate and check if the status is "OK" the condition should pass or if the status is "ERROR" then it s

Bash loop trough all users to delete password hints

I have newly started with bash and now I am facing the following problem: lukas@Lukass-MacBook-Pro Desktop % ./script.sh delete: Invalid Path <dscl_cmd> D

How to stop and start Docker container from bash script Synology?

Hey guys so I'm on a synology DS218+ and I'm running docker and hosting my own instance of gitlab in it. So now I'm trying to write an update Script with bash.

Prevent fast lane from checking App Store latest build number and increasing it

When I set a build number in my Xcode project lower than the latest uploaded build. Fastlane changes build number for the produced build and set it to latest+1.

Get homebrew to run a script after 'brew install x' or 'brew uninstall x'

I want to automate having a file that tracks all my installed brew packages. I can do this manually with brew list > somefile, how ever I want this process t

escaping newlines in sed replacement string

Here are my attempts to replace a b character with a newline using sed while running bash $> echo 'abc' | sed 's/b/\n/' anc no, that's not it $> echo

How to add Multiple user acccount with check and SSH key using Bash script

Based on my requirement in my dev server, I have Created a Linux function that will create a dev user,(Take the user's first name and create a Linux user ) we h

How to dynamically get the UID of the IOS simulator device and then install in that device

How to dynamically get the UID of the IOS simulator device and then install it in that device. I currently have this BASH script which does the job, however, wh

Behavior of sending email with text and attachment changed in Ubuntu 20.04 for mail from mailutils

In Ubuntu 16.04 I used the following command to send an email with text and attachements, which worked fine. echo "body" | mail -s "Subject" -A "/path/to/attach

Bash Scripts Are Not Executing From Production Build of Electron App

UPDATE: index.js file content added. I have this electron app that is executing some bash scrips(*.sh) files to perform some task. Everything is working absolut

(solved) bash script: how to cope with the different cp behaviors?

Among the tons of cp questions I have not found anything about this difference in behaviour (tested on Ubuntu 18.04). Sorry for the lost post, but the setting i

CyberArk ITATS004E Authentication failure for User in python script

I'm trying to implement a python script that executes local bash scripts or simple commands on remote CyberArk machines. Here is my code: if __name__ == '__main

Perl backticks using bash

In Perl, the default shell to execute backticks is sh. I'd like to switch to use bash for its richer syntax. So far I found that the suggested solution is `bash

Is there a way to get my laptop to beep from within a bash script running on a remote server via SSH?

I have a bash script that I have to regularly run on a remote server. Part of the script includes running a backup which takes a while, and after it has run, I

Log in to a site (Stack Overflow) by Bash

How can I log in to a website using Bash in Linux? For example, to log in to Stack Overflow I tried many different methods, shown below, but nothing's worked. w

Grep exclude count of occurence match between comments <!-- --> of curl body

I am very new to linux & bash script. I'm trying to read an xml file using curl command and count the number of occurrence of the word </entity> in it

Bash script for loop not exiting when command is successful

I have the following script #!/bin/bash echo '' maxTryTimes=10 for ((i=1; i <= maxTryTimes ; i++)); do echo "try setup mongodb replica ${i} ..." m

using python variables with bash magic in jupyter

I would like to run bash commands in jupyter notebook using the %%bash magic command and pass python variables. As described in this post I can do this as follo

How to make the ssh with -o StrictHostKeyChecking=no running on the docker in order to ssh the host work without exiting the script execution?

I have a script, that is running inside the docker container some actions we need for some internal debugging purposes: set -eu echo "Starting i/o test for hos