Category "bash"

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

How to use tqdm in bash for loops?

I have this for loop for example that takes so much time to finish so I want to use tqdm to have a nice progress bar like in python. But I can't find any way to

How to create a GitHub repository secret /encrypt it using bash on Ubuntu?

I'm trying to create/update a GitHub secret using bash on Ubuntu. Their api docs say that I should get the public key from the repo encrypt the secret with it c

Bash Scripts (even trivial ones) stuck when invoked on the terminal

I have a server on which we execute multiple bash scripts to automate tasks (like copying files to other servers, kicking off backups, etc). It has been working

Makefile error make (e=2): The system cannot find the file specified

I am using a makefile in windows to push some files on a Unix server (here a text file "blob.txt" in the same folder of my makefile). My makefile script is: se

Bash alias: command not found

I'm trying to setup a simple alias to move me into my Developer folder on my machine. However, after setting it up, I get a weird error: -bash: dv: command not

Processing text in bash - extracting the volume of a program from pactl sink-inputs output

Looking for a way to extract the volume from pactl list sink-inputs Output example: Sink Input #67 Driver: protocol-native.c Owner Module: 1

Bash- Converting a variable to human readable format (KB, MB, GB)

In my bash script, I run through a list of directories and read in the size of each directory to a variable using the du command. I also keep a running total of