[OS X TeX] OT: log from Acrobat 7.0

Peter Dyballa Peter_Dyballa at Web.DE
Sat Jul 29 13:48:25 CEST 2006


Am 29.07.2006 um 11:47 schrieb Sergei Mariev:

> However, every time I start Acrobat, I have to evoke top, get the  
> process number and then type sudo syslog -c foo -c, where foo is  
> the process number. Could someone help me to write a short shell  
> script to do it? it should search for the process by name and  
> return the number of the process Acrobat and then execute the above  
> line with the process number.

	ps -xwww | grep Adobe | grep -v grep | awk '{print $1}'

finds for me the process id of Adobe Reader. If the string "Acrobat"  
is part of the path name that is listed in ps' output, you should  
substitute my Adobe with your Acrobat.

This command sequence can now become either an executable shell  
script file, or an alias or a shell function in your shell. For tcsh  
you can put this line into ~/.cshrc or ~/.tcshrc, whichever exists:

	alias apid	"ps -xwww | grep Adobe | grep -v grep | awk '{ print "\ 
$1" }'"

For bash you can put this line into ~/.bashrc:

	alias apid="ps -xwww | grep Adobe | grep -v grep | awk '{ print "\ 
$1" }'"

On the command line in a *new Terminal* you can invoke:

	 sudo syslog -c `apid` -c


A shell script could be (not tested):

	#!/bin/sh
	#
	# some date, the script's name, some version info, some comment on  
the purpose
	#
	open /Applications/<the app's name here>
	#
	sudo syslog -c `s -xwww | grep Adobe | grep -v grep | awk '{print  
$1}'` -c

You would need to invoke the script with 'sudo <script's name>'. The  
Aqua application will run with your ID, but since you could prove  
that you were authorised to use sudo, the sudo in the script won't  
ask for your password again -- only in case the Adobe product manages  
to pass control back to the shell within a few  minutes. If this  
can't be guaranteed you would need to change the Adobe invocation to  
something like:

	/Applications/Adobe\ Reader\ 7.0.8/Adobe\ Reader\ 7.0.8.app/Contents/ 
MacOS/Adobe\ Reader >/dev/null 2>&1 &


Put the shell script best into the directory ~/bin ('mkdir ~/bin'  
will create it) and don't forget to 'chmod 755 <shell script's file  
name>' which makes it executable and invoked by simply typing '<shell  
script's name>'!

--
Greetings

   Pete

Got Mole problems?
Call Avogadro 6.02 x 10^23


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list