Category "bash"

Linux - How to get a string specific string from a specific line?

Lets say that I have the following DeletedFiles.txt file: test1.zip - date-removed='6-16-2021' test2.zip - date-removed='6-17-2021' test3.zip - date-remov

replace the header line of several sequences in a fasta file and replace them with the species names stored in a list (.txt)

I have a fasta file with several sequences, but the first line of all the sequences start with the same string (ABI) and I want to change and replace it with th

Executing a bash script from Electron app

I am trying to execute bash script within Electron index.html button click. Here's my code which index.html calling renderer.js, and renderer.js opens the bash

powershell return value $? and custom exit code [closed]

I installed powershell on Linux-Box. At end of my *.PS1 file I put the following code: Exit 2222 I run my ps1 file such as: pwsh-lts -File my

Recursively find files with a specific extension and copy them to a new directory with new names

I tried to find all the .xvg files generated by Gromacs inside a directory as well as its subdirectories and then copy them to a new directory, with new names f

If else script in bash using grep and awk

I am trying to make a script to check if the value snp (column $4 of the test file) is present in another file (map file). If so, print the value snp and the va

tmux resizep not working as expected if run in shell command

I'm triyng to setup a tmux session from a bash script, without using any session manager like tmuxinator/tmuxp/... If I run this code #!/bin/sh tmux \ new

WARNING: `pyenv init -` no longer sets PATH when starting the terminal window

Goal: I am trying to install the "pyenv" on my Linux machine with the help of this article "https://realpython.com/intro-to-pyenv/" Expected Result: according t

JQ - Get specific values under a key based on variable filter

So for class I have to make an shell script (BASH) that uses JQ to display a superheroes secret identity and powers. It has been a pretty fun course. The script

escape single quote awk command in jenkins pipeline

I get error "awk: fatal: cannot open file `print' for reading (No such file or directory)" when executing this command in jenkins pipeline. sh """ssh -o StrictH

Executing multiple commands with ssh, including evaluation of environment variables on the remote machine

I sometimes use ssh to run multiple commands on a remote host like this: ssh my_user@my_host "command1; command2" utilizing double quotes to send both commands

Add word using sed to the last column of csv

I tried the following sed and even I have set $ to set the path at the end it doesn't seem to be working. Also I dont know if there's any way of execute this li

Escape & character in groovy script while using curl

I'm using bash execution of curl in groovy script: descr = """ curl --silent -k -u test:test "https://bitbucket/rest/api/1.0/projects/test/repos/test/pul

Create folder tree from text file, folder names can contain spaces

I have a text file and I need to create the folder tree with a for loop in a script. Here's the text file I need to use. Animals.txt Animals Animals/Cats Animal

How are strings with multiple kinds of quotes interpreted in bash?

To give context, I'm trying to create a simple version of bash, and for that I need to mimic the way bash parses content with multiple sets of single and double

Convert list of interfaces from show vlan into full name list line by line

I need to take list of interfaces from show vlan: gi1/0/1, gi1/0/2, gi1/0/3, gi1/0/5, gi1/0/7, gi1/0/10 gi1/0/11, gi1/0/13, gi1/0/15, gi1/0/17, gi1/0/19 and ge

bash console output print layout

I want to make my writing to the console output in a nice tidy human readable. here is how it looks now: ====================== Sat Apr 16 12:57:17 EDT 2022 ===

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