Category "bash"

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

How to create an alias in a shell to go to parent directories

I'm wondering how to create an alias with endless arguments for going parent directories without alias name! Currently I have written this function to achieve

How to create an alias in a shell to go to parent directories

I'm wondering how to create an alias with endless arguments for going parent directories without alias name! Currently I have written this function to achieve

Bash : Find and Remove duplicate files from different folders

I have two folders with some common files, I want to delete duplicate files from xyz folder. folder1: /abc/file1.csv /abc/file2.csv /abc/file3.csv /abc/fil

Confirming Shell Script Input

I'm writing a script to preform a repetitive task that only changes basic values and locations such as user name. I've written up code that prompts for a usern

Copy Files from Windows to Windows Subsystem for Linux (WSL) [closed]

I have enabled developer mode and installed Bash on Ubuntu on Windows. My home directory can be found under %localappdata%\Lxss\home\<ubun

saving output of nettop to file ( mac ) [closed]

I'm trying to save the output of nettop from my terminal to a text file ( maybe .csv ) what I want to do is be able to isolate the different v

How to detect and remove indentation of a piped text

I'm looking for a way to remove the indentation of a piped text. Below is a solution using cut -c 9- which assumes the indentation is 8 character wide. I'm loo

How to declare a var in bash without it replacing a var in a different file

I have 2 files file1 and file2. Inside file1 I declare a var, x=1. In file2 I make a var x=2. If I run file one then file two, and then in the shell echo x, I g

substitute characters in a string in all possible combinations

Character substitution in all possible combinations I have string as follows, XGXXGXXGGXXGXXGX I would like to iteratively substitute X's for either one, two,

Replace tags in text file using key-value pairs from JSON file

I am trying to write a shell script that can read a json string, decode it to an array and foreach through the array and use the key/value for replacing strings

define environment variable in databricks init script

I want to define an environment variable in Databricks init script and then read it in Pyspark notebook. I wrote this: dbutils.fs.put("/databricks/scripts/i