Category "bash"

zip error - Nothing to do

I try to zip all folders in given directory. So I wrote this find /home/user/rep/tests/data/archive/* -maxdepth 0 -type d -exec zip -r "{}" \; but got zip e

Get absolut path to tmux.conf in tmux configuration file

I'm desperately trying to extract the absolute path of the tmux.conf file (which is a symbolic link) within the file itself. Usually one can achieve this easily

Why does this script works on one machine but not on the other? MacOS Catalina

I have this shell script which works on my machine just fine. To test the script I have a VM with the same OS Version, MacOSCatalina. On the "real machine" the

Can't start script via screen command

I have a script, and I want to make it work in background after boot. Therefore, I added the command below into rc.local. However, it doesn't work. sudo -iu exe

How to use source command within Jenkins pipeline script

I recently rewrite bash execution command into Jenkins pipeline. The old code is like ... source environment.sh //Build //Test ... Now I use pipeline script

Activating conda environment from bash script

I would like to change my conda environment from a bash script. I want to run bash script_yxz, where 'script_xyz' is like: #!/bin/bash conda activate my_env

Bash: how to unset an env variable with a hyphen (-)?

I have in my environment some variables that have an invalid identifier. When I try to unset them, I get the following error: $ unset A-B bash: unset: `A-B': n

Installing latest docker compose on Ubuntu

I use the following to install the most recent docker compose for my ubuntu server: curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-c

How can I access GitHub Action environment variables within a Bash script run by the Action?

I'm not able to access environment variables defined at the top-level of a GitHub Action configuration file from within a script run by the action. For example

Command to download latest version of nvm?

I am trying to install the latest version of nvm so (per this article) I ran: nvm install 4.0 It worked. But I want to make sure I install the latest version

Repeated negation (!) operators in bash do not negate each other

So this is more an oddity I've come up against than something I really want to use. But I found something I didn't understand with the bash extended test syntax

How to split a vcf.gz file based on the first column, keeping the header in each subset and save back to vcf.gz files

I have a large vcf.gz file (40GB) that I have to split to be able to load into R and run a script on each of the subset. I want to split it by the first column

Jq to replace text directly on file (like sed -i)

I have a json file that needs to be updated on a certain condition. Sample json { "Actions" : [ { "value" : "1", "properties" : {

Argocd getting started guide getting FATA[0000] configmap "argocd-cm" not found error

I just tried to go over the getting started guide of Argocd found here https://argo-cd.readthedocs.io/en/stable/getting_started/. I did steps 1 and 2 and then r

Vim 'n' not working in command mode

I have the line: public static void main(String args[]) with my cursor at the start. When I hit fc it correctly finds the first c at the end of public. When

print bash script comments when bash is executed

Assuming I have a bash script test.sh: #!/bin/bash # Comment 1 echo "Hello world" # Comment 2 echo "Hi there" I know after making the bash script executable

issue with swift container and relative/absolute path

I wrote a script which uploaded some files from a VM cinderblock to a swift object store. Unfortunately, I used a relative path to specify the file to upload.

Exporting JSON to environment variables

If I have a JSON like this, { "hello1": "world1", "testk": "testv" } And I want to export each of these key-value pairs as environment variables, how t

Using curl in a bash script and getting curl: (3) Illegal characters found in URL

So I have a very simple bash script that is curl'ing to an auth server for a header. The header url is written to a var and then used in the next curl call. Whe

Exporting JSON to environment variables

If I have a JSON like this, { "hello1": "world1", "testk": "testv" } And I want to export each of these key-value pairs as environment variables, how t