Skip to content

Tag: shell

Grep a line then print awk until a certain substring

My code is But, I want to have $9-$20 be stopped when it hits a value like (0) or (1). This will make my output format and look a lot nicer because anything after (0) or (1) is garbage. Does anyone have an idea on a way to implement that? Input: Output: EDIT: THANK YOU TO ALL THE PEOPLE THAT

Status after each argument passed to -exec in find

I’m writing a quick script to list all the files in a directory, run a function on each of them, and then print out the status code. Now the status code I would like is of the entire transaction and not the last expression that was executed. For example… Let’s say I have the following files …

Executing a script from a parent directory?

I have a root directory. In there I have ./bin/ In ./bin/ I have some bash scripts like: These scripts must be ran from ./bin, that is, the working directory must be: however, I would like to do: That last line would set the working directory temporarily to ./bin/ and would execute my script found in ./bin an…

Use Xargs to wait for enter key

So, I have a list of files that I want to use to generate a new set of groups of files. I want to open up these groups (multiple files) together at once. Edit them. Then go back to the terminal, hit enter, and open up the next group of files. I’ve got it working, but I’m using a temporary