Sponsored Content
Operating Systems Solaris How to get the path during runtime? Post 302285636 by vgersh99 on Monday 9th of February 2009 11:06:20 AM
Old 02-09-2009
Code:
echo '/solaris/opt/VRTS/bin/vxdisk' | sed 's#/VRTS/bin/vxdisk##'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

vi - replacing a relative path with absolute path in a file

Hi, I have a file with about 60 lines of path: app-defaults/boxXYZ....... I want to change this to /my/path/goes/here/app-defaults/boxXYZ, but of course vi doesn't like the regualr :s/old/new/ command. Is there any other quick way to do this? Thanks ;) (2 Replies)
Discussion started by: Yinzer955i
2 Replies

2. Solaris

Re:How to get the path during runtime?

Thank u vgesh99 It works well.. (1 Reply)
Discussion started by: Nandagopal
1 Replies

3. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

4. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

5. AIX

Embedding Runtime Search Path into Library on AIX

My product has 2 libraries say "x & y". x depends on y. During the installation of my products package, user will be prompted for his own location to copy my product libraries. Installation will copy libraries "x & y" and create my product specific ENV variable say "MYPATH" pointing to User... (4 Replies)
Discussion started by: erra_krishna
4 Replies

6. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

7. Shell Programming and Scripting

Generate class path dynamically based on source path

Hi experts, I have multiple file names ending with .jsp located in $SOME_DIR, $SOME_DIR/f1/,$SOME_DIR/f2/test,$SOME_DIR/f3/fa and there are equivalent class files in $SOME_DIR/WEB-INF/classes/_pages,$SOME_DIR/WEB-INF/classes/_pages/_f1,... (0 Replies)
Discussion started by: oraclermanpt
0 Replies

8. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

9. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

10. Programming

Makefile missing include path Although the path exists and defined

i have make file which i try to make them generic but it keeps to compline it missing include directory this is the makefile : CXX=g++ CPPFAGS= -Wall -O0 -g -std=c++14 INCLUDES = -I/home/vagrant/libuv/include -Isrc LIBS_DIRS = -L/home/vagrant/libuv/build LDFLAGS=... (7 Replies)
Discussion started by: umen
7 Replies
syseventadm(1M) 														   syseventadm(1M)

NAME
syseventadm - sysevent event specification administration SYNOPSIS
syseventadm add [-R rootdir] [-v vendor] [-p publisher] [-c class] [-s subclass] [-u username] path [args] syseventadm remove [-R rootdir] [-v vendor] [-p publisher] [-c class] [-s subclass] [-u username] [path [args]] syseventadm list [-R rootdir] [-v vendor] [-p publisher] [-c class] [-s subclass] [-u username] [path [args]] syseventadm restart The syseventadm command is an administrative front-end to add, remove and list sysevent event handlers. You can also restart the sysevent daemon by use of the restart command. syseventadm can only be run by root. The syseventadm add command adds a handler for a sysevent event specified by at least one of vendor, publisher or class. If class is speci- fied, it may be qualified with a sub-class. Only the values specified for vendor, publisher, class and sub-class when adding the handler are matched against sysevent events to determine if the specification matches the event and the handler should be run. path is the full pathname of the command to be run in response to matching events, with optional arguments (args). If username is specified, the command is invoked as user username, otherwise as root. The syseventadm remove command removes handlers for matching sysevent event specifications. Event specifications may be matched by specify- ing at least one of vendor, publisher, class, username or path. If class is specified, it may be qualified with a sub-class. Any of vendor, publisher, class, sub-class, username, path or args not specified match the corresponding fields of all events. Handlers for all matching specifications are removed. The syseventadm list command lists the handlers for matching sysevent event specifications using the same match criteria as the remove com- mand but without the requirement that at least one of vendor, publisher, class, username or path be specified. With no match criteria, all specifications are listed. The list command output format is: [vendor=vendor] [publisher=publisher] [class=class] [subclass=subclass] [username=username] path [args] where each of class, sub-class, vendor, publisher and username is listed only if part of the match criteria for the listed specification. The syseventadm restart command informs the syseventd daemon to reread the sysevent registry after a change has been made by adding or removing one or more sysevent handler specifications. Argument Macro Substitution The sysevent handling facility provides extensive macro capability for constructing the command line arguments to be executed in response to an event. Macro expansion applies only to the command line args specified for an event handler, with macros expanded with data from the event itself. Pre-defined macros are provided for the event class, subclass, publisher and vendor information. Macros not matching one of the pre-defined macro names cause the attribute list attached to the event to be searched for an attribute of that name, with the value of the matching attribute substituted on the command line. Macros are introduced by the $ character, with the macro name being the following token separated by a <SPACE> or <TAB> character. If the macro name is embedded in text, it may be delineated by ${ and }. A before the $ causes macro expansion not to occur. $class The class string defining the event $publisher The publisher string defining the event $sequence The sequence number of the event. $subclass The subclass string defining the event $timestamp The timestamp of the event. $vendor The vendor string defining the event Macro names other than those pre-defined are compared against the attribute list provided with the event. An attribute with name matching the macro name causes the value of the attribute to be substituted as ASCII text on the generated command line. Use of a macro for which no attribute with that name is defined, or for which multiple attributes with that name are provided, cause an error and the command is not invoked. Attributes with signed data types (DATA_TYPE_INT16, DATA_TYPE_INT32 and DATA_TYPE_INT64) are expanded as decimal digits. Attributes with unsigned data types (DATA_TYPE_BYTE, DATA_TYPE_UINT16, DATA_TYPE_UINT32, DATA_TYPE_UINT64 and DATA_TYPE_HTTIME) are expanded as hexadecimal digits with a 0x prefix. Attributes with string data type (DATA_TYPE_STRING) are expanded with the string data. The data is not quoted. If if it desired that the quoted strings be generated on the command line, put quotes around the macro call in the arguments. Array types are expanded with each element expanded as defined for that scalar type, with a space separating each element substitution. The add, list and remove subcommands support the following options: -c class Specify the event class, class. -p publisher Specify the event publisher, publisher. -R rootdir Specify an alternate root path, rootdir. Note - The root file system of any non-global zones must not be referenced with the -R option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5). -s subclass Specify the event subclass, subclass. -u username Specify the username (username) to invoke the command. -v vendor Specify the vendor (vendor) that defines the event. Events defined by third-party software should specify the company's stock symbol as vendor. Sun-defined events use SUNW. The add, list and remove subcommands support the following options: args Command arguments path Full path of command to be run in response to event Example 1: Adding an Event Handler The following example adds an event handler for an event defined by vendor MYCO ("My Company"), class EC_ENV and sub-class ESC_ENV_TEMP. The command to be run is /opt/MYCOenv/bin/ec_env_temp, with arguments being the class name, sub-class name and pathname derived from the event attributes. The $ characters are preceded by a backslash to circumvent shell interpretation. There is no need to restart the service after the change since the registry is maintained on $ALTROOT. # syseventadm add -R LTROOT -v MYCO -c EC_ENV -s ESC_ENV_TEMP /opt/MYCOenv/bin/ec_env_temp $class $subclass $pathname Note the caveat on the use of the -R option in the description of that option, above. Example 2: Removing an Event Handler The following example removes the event handler added in Example 1. # syseventadm remove -R LTROOT -v MYCO -c EC_ENV -s ESC_ENV_TEMP /opt/MYCOenv/bin/ec_env_temp class} subclass} pathname} Note the caveat on the use of the -R option in the description of that option, above. Example 3: Listing Event Handlers The following example lists all event handlers for events of class EC_ENV, subclass ESC_ENV_TEMP, as defined by vendor MYCO: # syseventadm list -v MYCO -c EC_ENV -s ESC_ENV_TEMP vendor=MYCO class=EC_ENV subclass=ESC_ENV_TEMP /opt/MYCOenv/bin/ec_env_temp ${class} ${subclass} ${pathname} Example 4: Listing Event Handlers The following example lists all event handlers defined by vendor VRTS. # syseventadm list -v VRTS Example 5: Removing Event Handlers The following example removes all event handlers defined by vendor VRTS, and restarts service. # syseventadm remove -v VRTS # syseventadm restart Example 6: Listing All Event Handlers Specified to Run a Command The following example lists all event handlers specified to run the command /opt/MYCOenv/bin/ec_env_temp: # syseventadm list /opt/MYCOenv/bin/ec_env_temp Example 7: Removing Event Handlers and Restarting Service The following example removes all event handlers specified to run the command /opt/MYCOenv/bin/ec_env_temp, and restarts service: # syseventadm remove /opt/MYCOenv/bin/ec_env_temp # syseventadm restart The following exit values are returned: 0 Successful completion. 1 No matching event specification found (remove or list commands only). 2 Incorrect command usage. 3 Permission denied. 4 Command failed. 5 Out of memory. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ syseventd(1M), sysevent_post_event(3SYSEVENT), attributes(5), ddi_log_sysevent(9F) To avoid upgrade problems, packages delivering a sysevent event handler should install the event handler by running syseventadm from the package's postinstall script. The event handler can then be removed by running syseventadm from the package's preremove script using the same arguments as when added. 28 Sep 2005 syseventadm(1M)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy