Category "bash"

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

command blkid don't show my partitions UUID

I'm using Ubuntu. command blkid or blk /dev/sda2 in LPIC-1 module 104.3 (mounting and unmounting). but these commands don't show me the expected results. blkid

How to use multiple CPUs with Python on a HPC?

I'm working on a data analysis project in Python and I'm using a HPC cluster to process my data. I'm having a hard time getting my program to use multiple CPUs