concatenate files in a pairwise manner

Bash
I would like to concatenate existing .txt files within a directory in a pairwise manner -creating all possible combinations of the original files. Im ...
1 year ago

Splitting bulk text file every n line

Bash
I have a folder that contains multiple text files. I'm trying to split all text files at 10000 line per file while keeping the base file name i.e. if ...
1 year ago

What is the Python equivalent of `set -x` in shell?

Bash
Please suggest Python command which is equivalent of set -x in shell scripts. Is there a way to print/log each source file line executed by Python? ...
1 year ago

How to search and remove ^M in all files in a directory recursively?

Bash
Files edited in Windows have M^ at end lines. How would I remove them ?
1 year ago

Pass python variables into a command

Bash
I'd like to pass variables 'first' and 'last' from my python snippet into a command. Python code: import csv import dateutil.parser with open('run...
1 year ago

Execute zgrep command and write results to a file

Bash
I have a folder containing lots of files like file_1.gz to file_250.gz and increasing. A zgrep command which searches through them is like: zgrep -...
1 year ago

How to read and update(increment) a value in a file with shell commands

Bash
I have a certain file which contains many contents, including a line from the format (for example) ABC = "x12" What I need to do is to increment th...
1 year ago

Why does `rm -i kk kk*` complain about a missing kk?

Bash
Well i want to understand how rm command works, What i tried: touch kk kk.999 (so it creates 2 blank files the kk and the kk.999) rm -i kk kk* (then...
1 year ago

Search for a string/pattern in selected text in BASH

Bash
I want to decrypt the selected text if the string "-----BEGIN PGP MESSAGE-----" occurs in the selected text. I have the following code but it doesn't ...
1 year ago

ls command and size of files in shell script

Bash
count=0; #count for counting IFS=' ' for x in `ls -l $input`; #for loop using ls command do a=$(ls -ls | awk '{print $6}') #print[6] is si...
1 year ago

Sort file based on information from different file

Bash
I have a file (f1) that contains two columns; f1 looks as follows: bob population1 sam population1 jen population2 amy population2 jim population3 bo...
1 year ago

Combining input and output shell IO redirection (in a nonstandard order)

Bash
What would this shell command do? ./myprogram > /dev/null < myfile.c And in general, how is this different from the other order of using <...
1 year ago

how to create a while do done script that has an exit and continue option?

Bash
I am trying to figure out how to create a while-do-done script in bash that will allow me to select options 1-4 and if I do use 1-4 will allow me to m...
1 year ago

Unable to change http writing permission on AFS'linux terminal?

Bash
on the shell for the school server, I have Normal Rights: system:administrators rlidwka http rl yfc439 rlidw httpsvc.webhost03.ucs.njit.edu r...
1 year ago

Redirect stderr and stdout in a Bash script

Bash
I want to redirect both stdout and stderr of a process to a single file. How do I do that in Bash?
1 year ago

How do I put an already-running process under nohup?

Bash
I have a process that is already running for a long time and don't want to end it. How do I put it under nohup (that is, how do I cause it to continu...
1 year ago

Cross platform alternative `mkdir -p` in makefile + cmake

Bash
I'm writing makefile, that works with cmake. makefile just creates the build directory and start cmake in it, if build directory is not created yet, o...
1 year ago

Trying to input date in a better looking manner

Bash
I'm new to shell script, and I've for a way to input date without asking the user to put day, month and year one at a time, any ideas?
1 year ago

Changing PS1 and PS2 depending upon outcome of previous command?

Bash
I am maintaining some shell scripts and one of the them (bash_profile.sh) has the following function defined. I don't quiet get what the purpose of t...
1 year ago

How to copy a directory structure but only include certain files

Bash
I found a solution for my question in Window but I'm using Ubuntu Here: How to copy a directory structure but only include certain files (using windo...
1 year ago