Skip to content
Advertisement

Tag: bash

How to grep a group of files within a specific time range

I’m trying to write a script used on a buffer box that does full packet capture of network traffic. As it’s for a fairly big network we split the captures into 100MB segments. At times of high network traffic oftentimes over a one minute period we will have multiple pcaps which cover that period. So what I want to do

gdb backtrace with no user input?

I’m wondering if it’s possible to launch an application via GDB, on a SegFault write the backtrace to a file (to look at later), and then exit GDB all without any user input. I’m running an application from a shell script in an infinite loop (so if it crashes it reloads) on OS boot from a non-interactive session. The application

Script for root to git pull as another user

I have a script that I would like to have do a git pull inside another user’s git directory. This script is run by the root user. For example: When I run this, I get: Is there a way to have my script do a git pull as username? Answer Try without the -i option to sudo. That option is

How to replace string with bash script and write back the Result

There is a CSV file with some columns, the first column is a 5 digit customer number, the other columns are separated with “;” Here is a example: If the first column is empty than I need to set the last given customer ID. The result should look like: Now I read the file linewise with bash script, and want

Number of processors/cores in command line

I am running the following command to get the number of processors/cores in Linux: It works but it does not look elegant. How would you suggest improve it ? Answer nproc is what you are looking for. More here : http://www.cyberciti.biz/faq/linux-get-number-of-cpus-core-command/

Bash script processing limited number of commands in parallel

I have a bash script that looks like this: But processing each line until the command is finished then moving to the next one is very time consuming, I want to process for instance 20 lines at once then when they’re finished another 20 lines are processed. I thought of wget LINK1 >/dev/null 2>&1 & to send the command to

Advertisement