Executing a Single UNIX Command
Using the UNIX Command window, you can send a single command to the selected client computers. The command is executed using the bash shell.
To execute a single UNIX command:
1Select a computer list in the Remote Desktop window.
2Select one or more computers in the selected computer list.
3Choose Manage > Send UNIX Command.
4Type or paste the command.
If your command is a
5Set the permissions used to execute the command.
You can choose the currently
6Click Send.
Executing Scripts Using Send UNIX Command
There are two kinds of scripts you can execute via the command line. First, and most common with command lines, is a shell script. A shell script is a file containing a collection of UNIX commands that are all executed in sequence. Shell scripts can have normal programming procedures like loops, conditionals, and variables. Shell scripts are text files with UNIX line endings. Shell scripts are interpreted using the bash shell.
The second kind of script you can execute, and the most common in the Mac OS X environment, is an AppleScript. AppleScripts are files that contain
Running a UNIX command as the current user will fail if the target computer is at the login window, since there is no current user at that point. You can use root user for tasks by entering root in the specified user field of the task dialog. You don’t actually need to have the root account enabled on the client computer to specify the root user. You should never use sudo or su to do tasks as the root user. They are interactive and expect further input and response from your script. Instead, run your script as root or whatever user you were planning on.
Executing Shell Scripts with Remote Desktop
Shell scripts can be copied, then executed. If a script has any degree of complexity, or if it cannot be expressed on a single line, you can use Copy Items to copy the script file to the client computers, then execute it using Send UNIX Command. To send a
Chapter 8 Administering Client Computers
145