Skip to content
Advertisement

Tag: shell

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

How to reproduce “Too Many open files” error in Shell

Assume that my open file limit is 1024 per process, Then how to reproduce Too Many open file error in shell script? I tried above, but it opens 10 files in 10 different processes. Answer You can use ulimit -n to set the maximum number of open files to a low number, and then open up more than that number

How do I tell awk not to make any changes to an empty row

I have a dataset with three columns that look like this: I want to subtract a certain number from each entry in the second column and I know how to do that. But with how the data looks, I end up getting an output that looks like this: How do I prevent awk from adding that extra “-0.1” in the

Find all files above a size and truncate?

Running cPanel on a server with various customer accounts under the /home directory. Many customers’ error_log files are exceeding a desired size (let’s say 100MB) and I want to create a cron job to run daily to truncate any files over a certain size. I know truncate can shrink files but it will extend files if they’re smaller than the

making a Hotel management system in BashScript

I am unable to correct the error. I have tried searching on Google but i can’t figure out what my output is referring to. Its giving a line number but the code is right there. “fi” is used at the end of IF statements in scriptfiles. This is my code I am attaching the output too Error while running the

Advertisement