Category "bash"

should I still declare GOPATH?

I WAS reading Learning GO and suggest that needs to be declared on PATH GOPATH="/home/user/go". this is from author: it’s a good idea to explicitly defin

How can I query in a bash script which of the haproxy load balancer hosts is currently the primary and which is the secondary?

I want to be able to determine which LB is primary and which is secondary from a bash script running on both load balancers. Background is: For the renewal of a

Repo forall reading to file

I am trying to get out some input into my files. I am doing this repo forall -c 'base=$(pwd);basename $base>names.txt' repo forall -c 'git rev-parse --abb

Prefix every line of bash script output with time since script start

Main question in the title: I want to prefix every line of script output with time since start of the script. Background. I use GNU parallel to run jobs, some o

How do I move Source Code from a local GitLab to AWS GitLab environment using automation?

As a part of my job, I have to automate Sorce code movement from development environment to Production environment. The developers push the code to GitLab that

Are shell scripts sensitive to encoding and line endings?

I am making a NW.js app on Mac, and want to run the app in dev mode by double-clicking on an icon. First step, I'm trying to make my shell script work. Using VS

Run Julia codes on a HPC server

I aim to run some Julia codes on a server (no complicated parallel processing involved) using a .pbs file (and qsub). It seems that I should first load module

Parsing list in bash

I have a text file which looks like this: ... unique_trigger = item1 item2 item3 ... itemN u

conditional binary operator expected with Do and ssh connection

This is part of my code that I working to find a word in a remote server connecting via ssh to that server filename=test.repo word=fail exists=$(grep -c $word $

timeout doesn't work with nvm: nvm no such file or directory

I want to set timeout for each instance of node.js running. but when I run the following commands I got the error timeout: failed to run command ‘nvm&rsqu

bash setting variable getting error command not found [duplicate]

I'm writing one small bash script for my Project but i getting some errors #!/bin/bash count=$(cat Downloads/datei.csv | wc -l); for((i=115;i&

Extract string in brackets using grep/sed/etc?

I am trying to obtain a file location for PHP-FPM, using the following piped commands works: ps aux | grep php-fpm | grep master Results: root 80 0.0

How do I Split Huge File into Chunks of equal size in bash

I have a huge file of 4GB of data i.e 523 rows & 2,655,566 columns. I would like to read the whole file in equally divided chunks. How to do so, suggest the

how to activate virtualenv created by pyenv in bash script?

I need to write a script to start gunicorn + django site which developed with pyenv the script is something like #!/bin/bash

Get user input for a Python script ran from a bash script

Tldr at the end I have a simple Python script with a few functions, let's give this main.py as a minimal example : import sys def userAdd(): var = inpu

How to add directory recursively on git safe.directory?

According to this QA, we may use safe.directory argument to add directory to be marked as whitelist, due to latest CVE found on git. But it seems there is no wa

Print all lines between line containing a string and first blank line, starting with the line containing that string

I've tried awk: awk -v RS="zuzu_mumu" '{print RS $0}' input_file > output_file The obtained file is the exact input_file but now the first line in file is z

how to print out all commands in bash script [duplicate]

I know "set -x" will print out commands in current script. but if the script a.sh runs b.sh then b.sh won't print out commands. is there a way

Should PATH contain directories or full paths to binaries?

I am trying to set up a correct PATH, but I'm wondering what it should contain. If I have /usr/bin/ls /usr/local/bin/ls and I want to prefer the one in /usr/

Grep sorting dates [closed]

Each day I have to manually identify each stuck call by looking for calls with a date older than the current day. I have managed to grep the r