Skip to content

Tracking a program’s progress reading through a file?

Is there a way to figure out where in a file a program is reading from? It seems like might be doable with strace or dtrace? To clarify the question and give motivation, say I have a 10GB log file and am counting the number of unique lines: $ cat log.txt | sort | uniq | wc -l Can I

Display duplicate lines in two different files

I have two files and I would like to display the duplicate line. I tried this but it doesn’t work : cat id1.txt | while read id; do grep “$id” id2.txt; done I am wondering if there are any other way to display the duplicate lines in the file. Both of my 2 files contain list of ids. Thank you…

Changing class variable in node declaration in Puppet

I am trying to create a “template” for all my servers. I have 2 configurations. An NTP client (which is taken care of in the baseclass class. I want to create an override specific for the NTP servers by declaring something specific in the node declaration. Something like “baseclass::ntp:rest…

How to exclude from `lsof` output the libraries?

I want to print in a log with the help of lsof the information about opened resources but I don’t want the customer to see what libraries are used. I browsed through the lsof man page but I cannot get a hold of how I can exclude only the libraries from the output. Is there an easy method to do

How can I use an at command in a shell script?

I am trying to use the Unix at command (for setting a job to run at a certain time) in a shell script. The time will be specified by user input using getopts and optarg which seem to be working fine, the problem is at. How do I write the at command into the script to run at a certain

Run script on completion of sge job

I am using sun grid engine 6.2u5 version . where requirement is when I submit job on using qsub command on completion job i want to run some script(bash scripts). how can i use -notify option or any other way to track job completion and after completion execute script. Thanks Answer I think hold_jid is what y…