Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Common Desktop Environment: Advanced User's and System Administrator's Guide > Chapter 10 Creating Actions Manually

Invoking Actions from a Command Line

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

The desktop provides the dtaction command for running actions from a command line. You can use dtaction to run actions from:

  • Scripts

  • Other actions

  • A terminal emulator command line

Syntax of dtaction

dtaction [-user user_name] [-execHost hostname] action_name [argument [argument]...]

-user user_name

Provides the ability to run the action as a different user. If dtaction is invoked by a user other than user_name, a prompt is displayed for the password.

-execHost hostname

For COMMAND actions only; specifies the host on which the command will be run.

argument

Arguments to the action; usually file arguments.

The dtaction client has additional command-line options. For more information, see the dtaction(1) man page.

Creating an Action that Runs Another Action

Use dtaction in the EXEC_STRING of the action.

For example, the following action uses a built-in action named Spell (the action is labeled ``Check Spelling'' in Application Manager). The new action runs Text Editor and the Spell action, displaying the spelling errors in a separate terminal emulator window.

ACTION EditAndSpell
{
WINDOW_TYPE NO_STDIO
EXEC_STRING /bin/sh -c 'dtaction Spell \
%Arg_1"File:"%; dtpad %Arg_1%'
}

Creating an Action that Runs as a Different User

Use the following syntax in the EXEC_STRING:

EXEC_STRING   dtaction -user user_name action_name [file_argument]

The new user (user_name) must have display access to the system through one of the following mechanisms:

  • Read permission on the login user's .Xauthority file

  • Or, xhost permission

For example, the following two actions provide the ability to become root and edit an app-defaults file.

ACTION AppDefaults
{
WINDOW_TYPE NO_STDIO
EXEC_STRING /usr/dt/bin/dtaction -user root \
EditAppDefaults %Arg_1"File:"%
}
ACTION EditAppDefaults
{
WINDOW_TYPE TERMINAL
EXEC_STRING /bin/sh -c 'chmod +w %Arg_1%; \
vi %Arg_1%; chmod -w %Arg_1%'
}
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.