Category "bash"

How can I find in a tsv file a value and 2 other values corresponding to the same row but in different columns USING GREP

So I have a tsv file that I opened in Numbers (Mac) and it has this aspect: sequence_id sequence v_call d_call j_call sequence alignment

Copy files with github-action

I am trying to write a GitHub action that makes a copy of a file in my repo into a different subdir in the repo. This is my dir structure (before the file is co

Why can't I start the top command in batch mode, stop it, and then resume it with fg?

I don't know why, so I would like to ask Gen... $ top -b and then Ctrl + Z to stop it, and then bring it back to foreground with $ fg %1 It does not work as des

summarise NA data from datafile on command line in linux / bash

I have a data file with missing values I want to summarise this data and find out how many NA there are in the whole data file and in certain specific cols I ha

How here document works in shell

While doing the input redirection, the shell opens the file on the right side of '<' with file descriptor 0, but in the case of the heredoc there is no such

Environment variables not defined in SSH AuthorizedKeysCommand (Docker)

I'm trying to make the private key SSH connection with LDAP. /etc/ssh/sshd_config AuthorizedKeysCommand /etc/ldap_ssh_authorized_keys.sh AuthorizedKeysCommandUs

How to combine multiple commands output in the one varialble in shell script?

I'm using the following script to get the data of one of the variables from the database file #!/bin/bash sqlite3 pdu.db <<'END_SQL' .timeout 2000 SELECT

BASH : control exits CASE logic after entering any condition - Unable to understand the reason

I have an input file, which has below data : driver2:y driver5:y driver3:n driver1:y driver4:y The requirement is, for each driver if the value is "y" then the

Do you need to include export for environment variables in bash profile / zshrc?

Do you need to include export for environment variables in Bash profile / zshrc? I'm using Z shell (Zsh) for my terminal and in my .zshrc file I have the two li

How to send prompt input to std::process::Command in rust?

I'm writing a cli tool for automate the archlinux installation, that is based on toml config files... Currently i have this problem... Once the base system is i

How to make a pipe conditional within the same line

textfolding="ON" echo "some text blah balh test foo" if [[ "$textfolding" == "ON" ]]; then | fold -s -w "$fold_width" | sed -e "s|^|\t|g"; fi The above code w

How to create and assign a variable name with special character in bash

Sorry if this question is repeated. how can I create a variable a.b and assign a value to it. ---------- root@IN2268980W3:# a=1 root@IN2268980W3:# a.b=1 a.b=1:

Extract tar achives into separate folders

I have a folder containing many tar archives archive1.tar archive2.tar ... I'd like to write a bash script which extracts their innard files to separate folders

How to write a bash command to open up a kafka producer and immediately follow with topic to create?

What's the best way to run the following sequence of commands kafka-console-producer --topic discounts --broker-list localhost:9092 --property parse.key=true --

How to create an alias composed of many commands?

Commands are: git checkout master git remote add upstream [email protected]:minio/console.git git fetch upstream git checkout master git rebase upstream/master Wh

Mutual Exclusion bug subtracting dates

I am trying to run bash code that errors when doing what I think is subtracting minutes from a date. There is an error that has to do with mutual exclusion that

"sleep 5" doesn't delay script for five seconds [closed]

When I use the sleep command and execute the script the sleep doesn't work. The code just gets executed without stopping for the expected 5 se

Splitting a file based on number of records and file size

I have a file which contains 100 records... Each record has different size, like some are 1 KB while some are 1 MB. I want to split the file based upon number o

How to iterate in a range determined by TWO variables?

I have a code: echo "the range's starting number:" read -r a #it was 10 echo "the range's ending number:" read -r b #it was 20 for (( c=$a; c<=$b; c++ )) do

diff 2 files and print only difference bash in Jenkins job

I try to diff to 2 file in bash in Jenkins job If i do this in minigw (eg gitbash) all working just fine But if run same command in Jenkins i got all from files