Skip to content
Advertisement

Tag: bash

Grouping and deleting Files

I have to come up with a solution to delete all files but the newest 2 in a directory stucture of our owncloud. The be exact – its the file versioning folder. There are files in one folder with the following structure: Filename.Ext.v[random_Number] The hard part is that there are different files in one folder I need to keep. IE:

AWK script automatically removing leading 0s from String

I have a file BLACK.FUL.eg2: I’ve written this AWK script: which gives me an output of: with one problem: the leading 0s of strings in field1, are automatically getting removed due to a numeric operation on them. So my actual expected output is: For that I’m trying the below updated AWK script: But getting an error: Can you please highlight

How can I control the number of running processes?

I’m doing a shell script and the unknown situation occurred. I must execute a certain number of processes, lets suppose 12. But I want to limit the executions by ‘t’ each time. So if ‘t’ is 3 I would have to execute 3 processes then 3, 3 and finally 3. But I would like to do it automatically, so I

How to open new bash terminal using Python

I am trying to open a new terminal window in Tkinter application. I’ve used os.system(“/bin/bash”) but it works in current bash only. Which stops runnning code and causes application freeze. I want to open new Terminal. How to do that? gedit like programs work fine without disturbing current apllication. Answer Try this:

Why is execvp() executing twice using fork()?

I am implementing a shell. When attempting a command other than changing directories, execvp() runs, the child terminates and a new child is created. When I change directories, the child does not terminate and a new child is created. Here is a sample of my code: cd ../; ls; runs correctly, except I have to Ctrl+D twice to end the

hard-coded bin path and NixOS

When I try to do a manual source install of some software on NixOS 15.09, I get (sh -x is to get an exec log): And indeed there is no bash program in /bin/ However when I inspect the script I dont see any mention of it so it must be some subprogram looking for it. As an aside, I

(Scp – Permission Denied (Public Key) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question

Advertisement