uux(1)								       uux(1)



NAME

  uux - Runs a command on another system

SYNOPSIS

  uux [-c | -C] [-n | -z] [- | -p] [-auser] [-bjr] [-ggrade] [-sfile]
       [-xdebug_level] command_string

  The uux command runs a specified command command_string on a specified sys-
  tem while enabling you to continue working on the local system.  This com-
  mand runs on systems that support the UUCP protocol.

FLAGS

  -   Makes the standard input to uux the standard input to the
      command_string.  Same as -p.

  -auser
      Replaces the user ID of the person issuing the command with user ID
      user.

  -b  Returns standard input to the command if the exit status is not zero.

  -c  Transfers the source files to the destination on the specified system.
      The source files are not copied into the spool directory for transfer.
      (See the description of the -C flag.)

  -C  Transfers the source files to the spool directory.  After a set period
      of time, (specified in the uusched program) the uucico daemon attempts
      to transfer the files to the destination on the specified computer.
      This flag is on by default.
      Occasionally, there are problems in transferring a source file; for
      example, the remote computer might not be working, or the login attempt
      might fail.  In such cases, the file remains in the spool directory
      until it is either transferred successfully or removed by the uucleanup
      command.

  -ggrade
      Specifies when the files are to be transmitted during a particular con-
      nection.	grade is a single number (0-9) or ASCII letter (A-Z, a-z);
      lower ASCII-sequence characters cause the files to be transmitted ear-
      lier than do higher sequence characters.	The number 0 is the highest
      (earliest) grade; z is the lowest (latest).  The default is N.

  -j  Displays the job identification number of the process that is running
      the command on the specified system.  Use this job number with the uus-
      tat command to check the status of the command, or with uustat -k to
      terminate the process.

  -n  Prevents user notification by mailx of whether the command executed
      successfully.  The default is to notify you if the command fails.

  -p  Uses the standard input to uux as the standard input to command_string.
      A - (dash) has the same effect.

  -r  Prevents the starting of the spooling program that transfers files
      between systems.	The default is to start the spooling program.

  -sfile
      Reports the status of the transfer in a file specified by file on the
      designated system.

  -xdebug_level
      Displays debugging information on the screen of the user's terminal.
      The debug_level is a number between 0 and 9.  The higher number gives a
      more detailed report.

  -z  Notifies you if the command executed successfully on the specified sys-
      tem.  In that case, you are notified about the failure through the mail
      system.

DESCRIPTION

  The command gathers various files from the designated systems, if neces-
  sary.	 It then runs a specified command on a designated system.  The user
  can direct the output from the command to a specified file on a specified
  system.  (For security reasons, many installations permit uux to run only
  the rmail command.)

  The uux command creates execute (X.*) files that run commands on the local
  system.  In addition, uux also creates both command (C.*) files and data
  (D.*) files.

  Execute files contain the command string to be executed on the designated
  system.  Command files contain the same information as those created by the
  uucp command.	 Data files either contain the data for a remote command exe-
  cution, or else become X.* files on remote systems for remote command exe-
  cutions.

  The full pathname of an execute file is a form of the following:

       /usr/spool/uucp/system/X.systemNxxxx

  After creating the files in the spooling directory, uux calls the uucico
  daemon, to transfer the files from the spooling directory on the local sys-
  tem to the designated remote system.	Once the files are transferred, the
  uuxqt daemon executes the command_string on the specified system, placing
  any output from the command in a designated file on a specified system.

  The command_string variable is made up of one or more arguments that look
  like a command line, except that command_string might be prefixed by sys-
  tem!.	 The default system is the local system.

  Unless the -n flag is specified, uux notifies you if the remote system does
  not run the command.	This response comes by mailx from the remote system.

  Filenames, Pathnames, and System Names


  When specifying the destination of the output of a command, you can enter
  uux in either one of the following formats:

    +  uux [option ...] command_string > destination

    +  uux [option ...] command_string \{destination\}

  Destination names can be either of the following:

    +  A full pathname.

    +  A full pathname preceded by ~user, where user is a login name on the
       specified system.  The uux command replaces this pathname with your
       login directory.

  The shell pattern-matching characters ?, *, and [...] can be used in the
  pathname of a source file (such as files compared by the diff command); the
  appropriate system expands them.

  Shell pattern-matching characters should not be used in the destination
  pathname.

  Place either two \ (backslashes) or a pair of " " (double quotes) around
  pattern-matching characters in a pathname so the local shell cannot inter-
  pret them before uux sends the command to a designated system.  If using
  the special shell characters >, <, ;, or | in a pathname, precede each spe-
  cial character with \ or place "..." around the entire command string.  Do
  not use the shell redirection characters << or >> in a pathname.

  The uux command attempts to move all files specified on the command line to
  the designated system.  Enclose the names of all output files in
  parentheses so that uux does not try to transfer them.

  When specifying a system, always place it before the command_string in the
  entry.  System names must contain only ASCII characters.

  The ! (exclamation point) preceding the name of the local system in a com-
  mand is optional.  If you choose to include the ! to run a command on the
  local system using files from two different remote systems, use ! instead
  of system! to represent the local system, and add system! as the first
  entry in any pathname on the remote systems.

  The exclamation point representing a remote system has a different meaning
  in C shells (csh).  When running uux in a C shell, place a \ (backslash)
  before the exclamation point in a system name.

  If the command being executed requests two files stored on the same system,
  or two files with the same name that are stored on separate systems, the
  command will be executed, but will not produce the desired results.

  The following two commands will be executed:

       uux "nhk!/usr/bin/diff /usr/amy/out1 nhk!/u/amy/out > ~uucp/DF"

       uux "nhk!/usr/bin/diff nhk!/usr/amy/out1 XXX!/u/amy/out > ~uucp/DF"


  (The notation ~uucp is the shorthand way of specifying the public spooling
  directory /usr/spool/uucppublic.) In the first command, diff is on system
  nhk, the first source file is on the local system, the second source file
  (with a different name) is on system nhk, and the output is directed to the
  file DF in the public directory on the local system.	In the second com-
  mand, diff is again on nhk, the first file is also on nhk, the second file
  (with a different name) is on XXX, and the output is again directed to DF
  in the ~uucp directory.

  The following command will not be executed properly:

       uux "nhk!/usr/bin/diff XXX!/u/amy/out merl!/u/amy/out > ~uucp/DF"


  This command will not be executed because, although the files are on two
  different systems, they still have the same filename.


EXAMPLES

   1.  To run the lp command on a remote system, enter:
	    uux merl!lp /reports/memos/lance

       In this example, the file /reports/memos/lance is printed on the
       remote system merl.  Unless the -n flag or the -z flag is specified,
       the uux command notifies you if the remote system fails to run the
       command.	 The response comes by the mailx command from the remote sys-
       tem.

   2.  To run commands on two remote systems, enter the information on
       separate command lines, enter:
	    uux merl!print /reports/memos/lance
	    uux zeus!print /test/examples/examp1

       In this example, the file /reports/memos/lance is printed on the
       remote system merl, and the file /test/examples/examp1 is printed on
       the remote system zeus.

   3.  To get the job_number of a job and then compare a file on the local
       system zeus with a file on a remote system when the diff command is
       stored on the local system, use either of the following formats:
	    uux -j "/usr/bin/diff /usr/amy/f1 nhk!/u/amy/f2 > ~uucp/f1.diff"

       or
	    uux -j /usr/bin/diff /usr/amy/f1 nhk!/u/amy/f2 \{~uucp/f1/diff\}

       This command gets the file /usr/amy/f1 from the remote system nhk,
       compares it to the file /u/amy/f2 on the local system zeus, and places
       the output of the command in the local public directory in a file
       named f1.diff.  (The full pathname of this file is
       /usr/spool/uucppublic/f1.diff.)	Using the -j flag produces the output
       zeusN52d9.
       As shown in the example, the destination name must be entered in one
       of two ways:

	 +
	 Preceded by a > (redirection symbol) with the whole command string
	 enclosed in "..." (double quotes)

	 +
	 Enclosed in braces and backslashes, as \{...\}

   4.  To compare files that are located on two different remote systems, nhk
       and XXX, using the diff command on the local system, enter:
	    uux "!/usr/bin/diff nhk!/usr/amy/f1 XXX!/u/amy/f2 > !f1.diff"

       This command gets the file /usr/amy/f1 from the system nhk and the
       file /u/amy/f2 from XXX,	 runs a diff command on the two files, and
       places the results in the file f1.diff, located in the current working
       directory on the local system.
       Additional points:

	 +
	 This output file must be write enabled.  If you are uncertain about
	 the permission status of a specific target output file, direct the
	 results to the public directory.

	 +
	 The exclamation points representing the local system are optional.

	 +
	 Both of the examples above use a > (redirection symbol) preceding
	 the name of the output file.  When using the special shell charac-
	 ters >, <, ;, or |, either quote the entire command_string, or quote
	 the special characters as individual arguments.

   5.  To specify an output file on a different remote system, enter:
	    uux nhk!uucp XXX!/u/amy/f1 \{merl!/u/geo/test\}

       This command runs uucp on the remote system nhk.	 The uucp command
       then sends the file /u/amy/f1, stored on system XXX, to user geo on
       system merl as test.

   6.  To get selected fields from a file on remote system nhk and place them
       in a file on the local system, enter:
	    uux "cut -f1 -d: nhk\!/etc/passwd > ~uucp/passw.cut"

       This command runs cut on the local system, gets the first field from
       each line of the password file on system nhk, and places the output in
       the file passw.cut in the public directory on the local system.
       In this example, uux is running in a C shell, so a \ (backslash) must
       precede the ! (exclamation point) in the name of the remote system.

FILES

  /usr/spool/uucp
	     Spooling directory.

  /usr/lib/uucp
	     Contains the uucico daemon.

  /usr/spool/uucppublic
	     Public directory.

RELATED INFORMATION

  Commands:  ct(1), cu(1), mailx(1)/Mail(1), rmail(1), sendmail(8), tip(1),
  uucico(8), uucleanup(8), uucp(1), uuencode(1)/uudecode(1), uulog(1),
  uuname(1), uupick(1), uusched(8), uusend(1), uustat(1), uuto(1).