Skip to content
Advertisement

Tag: bash

Why is kill -2 not killing the process?

EDIT: From my tests, it seems not to be possible to terminate a process with the SIGINT/SIGQUIT signal from a script. I do not know why though. I am working on Centos 7, with bash. I would like to know why isn’t kill -2 $pid killing the process. I have a master script that starts a subprocess. That subprocess stays

bash extract version string & convert to version dot

I want to extract version string (1_4_5) from my-app-1_4_5.img and then convert into dot version (1.4.5) without filename. Version string will have three (1_4_5) or four (1_4_5_7) segments. Have this one liner working ls my-app-1_4_5.img | cut -d’-‘ -f 3 | cut -d’.’ -f 1 | tr _ . Would like to know if there is any better way rather

Bash script – Loop through directory with regex

I’m sure this must be possible, but I’m not sure how. What I’m trying to do is loop through a directory, looking for numeric directories within, and get their disk space. This is what I’ve come up with, but it’s not dealing with the regex. In case it’s not clear, I have a directory containing a bunch of directories with

Redirect parallel process bash script output to individual log file

I have a requirement, where i need to pass multiple arguments to the script to trigger parallel process for each argument. Now i need to capture each process output in the separate log file. Above piece of code can only give parallel processing for the input arguments. I tried with exec > >(tee “/path/of/log/$arg_filedate +%Y%m%d%H.log”) 2>&1 and it was able

Advertisement