Category "bash"

Convert text to associative array in bash script [closed]

Hi I am new to bash scripting. I have a text as shown below input = {'A': '1' 'B': '2' 'C': 'Associative_Array'} I want to convert the above t

Azure Devops Get a repositoryId by using repository name

I am writing a BASH script, where its creating an azure repo and then pushing code. post this step it will go-ahead and create an azure pipeline via azure-pipel

How to check if /tmp and /proc filesysystems are mounted in a chrooted environment?

I have already tried mounting the filesystems without checking like this: sudo -- mount -t proc /proc $chroot_dir/proc sudo -- mount --bind /tmp $chroot_dir/tmp

Show call stack in Bash

To start with, I do not know if this is something trivial and common knowledge; I don't know, so am asking here. I am running a 3rd party app and trying to nai

Extract a string between double quotes from the 6th line of a file in Unix and assign it to variable

Newbie to unix/shell/bash. I have a file name CellSite whose 6th line is as below: btsName = "RV74XC038", I want to extract the string from 6th line that i

How to wait in bash script to subprocess, if one of them failed so stop everyone

How to wait in bash script to subprocess and if one of them return exit code 1 so I want to stop all subprocess. This is what I tried to do. But there are a som

Looping through all files in a directory [duplicate]

I want to write a shell script that will loop through all the files in a directory and echo "put ${filename}". Can anyone point me in the righ

Getting the error: bash: (program): cannot execute binary file: Exec format error, on both 32-bit and 64-bit Windows

There is a program developed for linguistic research (http://people.csail.mit.edu/mcollins/code.html). When I try to run the parser using Git bash terminal on W

How to login to bash with current user, and the user's .bashrc file, in jupyterlab?

I have a configuration file setup in .bashrc which I would like to apply to all terminals opened automatically in my jupyterlab. Currently jupyterlab terminal

npm install -g truffle install visual studiosVsCode

I'm trying to follow this video and I think I'm doing something wrong, this is what is appearing in my terminal: .

Bash script to send commands to remote ssh session

Is it possible to write a bash script that opens a remote node (i.e. through ssh and/or slurm) and starts an interactive session there after running some comman

How to concatenate variables and strings as a full path for the "output file" of an ffmpeg command in a bash script

I'm trying to learn to bash scripting and I tried to use variables and arguments, etc. to specify a complex output file name to a ffmpeg command as follows : fo

WSL, Running linux commands with "wsl --exec <cmd>" or "wsl -- <cmd>"

wsl -h shows the following: --exec, -e <CommandLine> Execute the specified command without using the default Linux shell. -- Pass the remainin

Align around a given character in bash

Is there an easy way to align multiple rows of text about a single character, similar to this question, but in bash. Also open to zsh solutions. What I have: aa

Iterate over a csv and change the values of a column that meets a condition

I have to use bash to iterate over a CSV file and replace the values of a column that meets a condition. Finally, the results have to be stored in an output fil

Firebase app distribution via Fastlane "the server responded with status 403"

I setup Firebase app distribution feature in Fastlane Fastfile to distribute beta version of my iOS app. It was working fine but It suddenly started showing err

Generate a Random Output from the List of Multiplicities of a Number X up to a MAX Number Y?

Using a bash script, I want to choose a random number from such a list: [0, X, 2X, 3X, 4X, ..., Y] where Y=k*X and k is an integer. X and Y are just some input

Standard Deviation from multiple files in bash

I wish to calculate the standard deviation from a range of files titled "res_NUMBER.cs" which are formatted as a CSV. Example data includes 1,M,CA,54.9130 1,M

Trying to display different colors through bash script

I'm new to scripting and have decided to learn with this homework that I gave myself. The goal of this script is simply: display available colors in color pick

Conditional splitting of a HUGE file

I have a really huge file (>500 million lines) that I want to split in several smaller files according to the first 3 characters of one of its columns. It l