Skip to content

Tag: bash

awk combine sequence with substring key

I have two files for combining with tab delimited file. That two files key might be different only for “Reads” number. I want to compare that two files and combined based on substring key and match. Forexample, This case I want to combine that two column with File1 Key name. Please check below exa…

List all groups on machine via bash script

This code gives me an output of 1000 if I’m a regular user or 0 if I’m root, while executing the same command (cut -d: -f1 /etc/group) returns a list of all the available groups on the machine. I also tried with grep “” /etc/group but that produces the same results. What am I not getti…

Attach to a GNU screen and then execute commands

I have seen some similar questions asked but the solutions don’t seem to work in my case. I am trying to SSH into a specific screen instance on a Node machine and then execute some commands My current process is this: On the remote machine I create a screen instance: screen -dmS “my_screen” …

Prevent accidental history editing in bash

I recently switched from tcsh to bash, and one thing that keeps tripping me up is how bash handles history. I regularly bring up a previous history command and begin to edit it, but realize I need to run a different command first. In bash, this edits the original command, and I cannot see what I originally ty…

Run find command from a bash file

Hi people: I’m making a xfe script to take a given directory as source file, use zenity to get output dir and perform some operations, for example: When the script is invoked, oggenc is not executed…any ideas? Solution: Based on answers bellow, this works as expected: Answer To make the variable $…