10-27-2013
Include libexec directory for script when run
Hi everyone!
This is my first post, so bear with me.
I have this script, vpm, which make use of the libexec directory for commands intended to be run by the bin/vpm binary. I want to add the libexec directory to $PATH when running the vpm binary. I don't want the script itself to try figure out where the path is, so I want to specify the path during installation.
Currently the binary have this line export PATH="%VPM_LIBEXECDIR%:$PATH". When I install the script I just replace "%VPM_LIBEXECDIR%" with the actual path.
This works, but it's problematic when I develop locally because then I just want to run the script directly by going to the directory and run ./bin/vpm.
How does people usually solve this problem?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to include all the subnet files under /etc/dhcpd/ to /etc/dhcpd.conf
so here is my content of dhcpd.conf
...
include "/etc/dhcpd/*";
however, the check-syntax reports syntax error, as they do not recognize the wildcard *, and display that " file /etc/dhcpd/* could not be found.
... (4 Replies)
Discussion started by: fredao
4 Replies
2. Shell Programming and Scripting
I have a script at /java/custom/build.sh
I want to force the user to execute the script from the /java/custom directory ONLY. In other words if the user is in /java I want to exit if they execute custom/build.sh
The directory structure may change from the env to env, so I can't use... (4 Replies)
Discussion started by: t_c_1980
4 Replies
3. Shell Programming and Scripting
Hi folks
I have a unix script script1 in a directory folder1 and also I have few input log files in this directory. My input log files will be copied into this directory folder1 from the portable thumb drive.
Now what I want is I need to run this script1 whenever any new file is copied... (2 Replies)
Discussion started by: ks_reddy
2 Replies
4. Shell Programming and Scripting
Hi I am trying to write a shell script that is reading all the scripts in the current directory (currently 5) and is allowing me to run the scripts that is in the directory.
I want that this scripts asks te user to execute 1 of the listed scripts.
I have 4 sample scripts in the directory:... (8 Replies)
Discussion started by: I-1
8 Replies
5. UNIX for Dummies Questions & Answers
The way this works from the command prompt is:
___________________________________________
cd /data/local/bin
chmod 0755 file.bin
./file.bin
_______________________________________________
How do I make this happen in a script. The file must be run in its directory but I can not get the... (2 Replies)
Discussion started by: chrstdvd
2 Replies
6. Shell Programming and Scripting
I have N number of python scripts which i am receiving from REST web server and i am saving them in /home/mandar/ . Now i want to write a script to run all the python scripts from this directory and monitor them every minute...if any process is dead or hung it should be restarted by this script.
... (0 Replies)
Discussion started by: Mandar Nandale
0 Replies
7. Shell Programming and Scripting
Hi,
I have created a Shell Script and invoke through java using Process Builder
It's working fine, if (Shell script file ) in the same directory as java file.
By Problem:
How to run the Shell Script file( resides in external directory) using java. What configuration i have... (1 Reply)
Discussion started by: nanthagopal
1 Replies
8. Programming
I want to run a test for the gem mini_magick:
https://github.com/minimagick/minimagick
I got the directory lib, inside of which i got:
- mini_magick.rb
- mini_gmagick.rb
and inside of the test folder is the test i need to run:
- image_test.rb
and a helper file called:
- test_helper.rb
... (1 Reply)
Discussion started by: tornow
1 Replies
9. Shell Programming and Scripting
This script writes the output files to FILES but I don't want to exclude all directories from ABC_CHQ and LYS_ADV, I want to include one sub directory name process which is under ABC_CHQ and LYS_ADV in the search. Right now its excluding everything from prune directories such as ABC_CHQ, LYS_ADV... (10 Replies)
Discussion started by: John William
10 Replies
10. Shell Programming and Scripting
How to run a script/command on all the directories in a directory tree?
The below script is just for the files in a single directory, how to run it on all the directories in a directory tree?
#!/bin/sh
for audio_files in *.mp3
do
outfile="${audio_files%.*}.aiff"
sox "$audio_files"... (2 Replies)
Discussion started by: temp-usr
2 Replies
LEARN ABOUT OPENDARWIN
dylibprof
DYLIBPROF(1) General Commands Manual DYLIBPROF(1)
NAME
dylibprof - control the shared pc sampling of a dynamic shared library
SYNOPSIS
dylibprof [-e | -d] | [-c | -r | -b | -h | -p [-o <file>] <dylib>]
DESCRIPTION
Dylibprof along with the server /usr/libexec/profileServer allows shared program counter sampling of a dynamic shared library across all
the programs that use the library.
To use dylibprof(1), /usr/libexec/profileServer must be running. So first start /usr/libexec/profileServer and leave it running in the
back ground:
% /usr/libexec/profileServer >& /dev/console &
/usr/libexec/profileServer starts up with shared pc sampling disabled. It should not be left running with shared pc sampling enabled if no
sampling is being done as every launch of a program that uses the dynamic linker is effected. This is true even to a small extent if there
no libraries being sampled.
If you need to profile from boot up for all processes then the following line can be added to /etc/bootstrap.conf:
server "/usr/libexec/profileServer" services NSProfileServer NSProfileControl;
Before any dynamic shared library can be sampled sampling must be enabled as
follows:
% dylibprof -e
It can then later be disabled when no more sampling is to be done with:
% dylibprof -d
EXAMPLE
To sample the dynamic shared library /System/Library/Frameworks/System.framework/Versions/B/System for example requires the following
steps. First create a sample buffer for the library:
% dylibprof -c /System/Library/Frameworks/System.framework/Versions/B/System
Then begin the sampling:
% dylibprof -b /System/Library/Frameworks/System.framework/Versions/B/System
After this programs launched using this library will be part of the shared pc sampling. Typically what would be done is to then use the
system normally for a number of hours.
Then to halt the sampling:
% dylibprof -h /System/Library/Frameworks/System.framework/Versions/B/System
The profiling output file (a gmon.out file) can be created with:
% dylibprof -p -o /tmp/gmon.out /System/Library/Frameworks/System.framework/Versions/B/System
Using the profiling output file and the library a profile listing and a time based order file (time.order) can be created with: gprof(1):
% gprof -S /System/Library/Frameworks/System.framework/Versions/B/System /tmp/gmon.out
When no more sampling for this library is to be done the sample buffer can be
removed with:
% dylibprof -r /System/Library/Frameworks/System.framework/Versions/B/System
The options are:
-e Enable shared program counter sampling for dynamic libraries.
-d Disable shared program counter sampling for dynamic libraries.
-c Create a pc sample buffer for the library.
-b Begin sampling for programs subsequently launched using the library.
-h Halt sampling for programs subsequently launched using the library.
-p Produce a profiling output file (a gmon.out file) for the library.
-r Remove the pc sample buffer for the library.
-o name
Use the file name instead of gmon.out when producing the profiling output file with the -p above.
FILES
gmon.out profile output file
/var/tmp/profile/profile.XXXXXX the sample buffer file
SEE ALSO
gprof(1)
Apple Computer, Inc. March 19, 2002 DYLIBPROF(1)