TAG(1)                                                                  TAG(1)


NAME
     tag - tag a MIPS executable or shell script with an identifying number

SYNOPSIS
     tag number filename[s]
     tag -c filename[s]
     tag filename
     tag -q filename[s]
     tag -[ltoxn] filename[s]

DESCRIPTION
     tag is used to set, clear or query the tag number in a MIPS executable or
     shell script that follows the convention of #!/bin/sh or #!/bin/csh on
     the first line.  The tag number is used by the IRIX Interactive Desktop
     to determine the type of a file and thus display the appropriate icon and
     have it exhibit the correct behavior when the user interacts with it.

     Usually software developers use the tag command.  End users have no need
     to use the tag command.  End users who create their own personal desktop
     icons might be curious to understand tags, but tags are not required for
     creating personal icons.  Such users can read the comments in the
     /usr/lib/filetype/Makefile.personal file for step-by-step instructions on
     creating personal desktop icons.


     Here are the options for viewing and setting tags:


     tag number filename[s]
                           Sets the tag number of a MIPS executable or script.
                           Many executables or scripts can be tagged with the
                           same number, if it's desirable that they look and
                           behave the same way.  The tag number must be non-
                           negative and less than 4294967296.

     tag -c filename[s]    Clears the tag(s) on the specified file(s).

     tag filename          Prints the tag number of a MIPS executable or
                           script.

     tag -q filename[s]    Prints the tag numbers of a list of MIPS
                           executables or scripts.  Be sure to specify a full
                           directory path in the filename.

     tag -[ltoxn] filename[s]
                           Can be used to tag the file[s] with a pre-existing
                           SGI defined type defined in the
                           /usr/lib/filetype/system/sgicmds.ftr file.


     The -ltoxn flags can be used in any combination.  When used in
     combination, the individual tag values for each flag are logically OR'd
     together to form the resulting tag.  Example: The command

         tag -ln /usr/people/maria/my_app

     will cause the /usr/people/maria/my_app executable to be tagged with the
     hexadecimal tag 0x120.  The tag command generates this tag by ORing the
     tag 0x100 (for -l) with the tag 0x20 (for -n).  The above example is
     equivalent to this:

         tag 0x120 /usr/people/maria/my_app


     The -ltoxn flags have the following effects:

     l         (Tag 0x100) A `launch' dialog window is executed to allow the
               user to enter command line arguments with which the command is
               run.  Examples: The executables /usr/bin/ln and /sbin/mkdir are
               tagged 0x100.

     t         (Tag 0x400) A terminal emulator is started and the command is
               executed from within the terminal emulator.  This is intended
               for use with commands that require terminal input and output.
               Examples: The executables /usr/sbin/top and /usr/bin/passwd are
               tagged 0x400.

     o         (Tag 0x600) An output-only terminal emulator is started up and
               the command is executed from within the terminal emulator.
               This is intended for use with commands that produce text
               output, but require no input.  Examples: The script
               /usr/sbin/relnotes and the executable /usr/bsd/hostname are
               tagged 0x600.

     x         (Tag 0xf00) The command is not executable from the IRIX
               Interactive Desktop.  This is intended for commands that make
               no sense when executed from the desktop.  For example, if a
               command can be used only when called from other programs, then
               the command should be tagged using this argument.  Examples:
               The scripts /usr/bin/false and /usr/bin/true are tagged 0xf00.

     n         (Tag 0x20) Other files are required to be passed to the command
               as arguments.  That is, the user must drop one or more file
               icons onto the command icon.  This tag is most often combined
               (OR'd) with other tags.  Examples: The executables /sbin/cat
               and /usr/sbin/tag are tagged 0x620 and 0x720, respectively.

     Note: Even if a file is tagged correctly, the desktop might not show the
     file with the correct icon if the file permissions are not set to
     executable.  When you tag a script or executable, also make sure it is
     executable:


         chmod a+x filename


     To see and verify changing tags, open a dirview window displaying the
     directory where your script or executable lives:

         /usr/sbin/dirview directory

     As you change the file's tag on the command line, the file's icon will
     change accordingly.  Double-click the file's icon to confirm its behavior
     is as desired.

     Software developers who are interested in creating their own brand-name
     icons and behaviors (instead of using the standard tags) can obtain a
     block of unique tags for their own use.  To obtain a block of unique tags
     (at no cost), send electronic mail to

         desktoptags@sgi.com

     or telephone

         (650) 933-TAGS, or (650) 933-8247

     and leave a message with your name, email address, telephone number, and
     fax number.  If calling from outside the U.S., include also country and
     city codes.  Please use this email address and telephone number for tag
     requests only.

     For MIPS ELF 32-bit executables, the tag number is stored as a 32-bit
     word in the MIPS .reginfo section. The second word in the .reginfo
     section is set when the file has been tagged and will not be set
     otherwise. The tag number, also a 32bit word, immediately follows the tag
     flag.

     For MIPS ELF 64-bit executables, the tag number is stored as a 32-bit
     word in the ODK_TAGS options descriptor of the .MIPS.options section. The
     first byte in the ODK_TAGS options descriptor section is set when the
     file has been tagged and will not be set otherwise. The tag number, a
     32bit word, immediately follows the tag flag.

     For shell scripts, the line `#Tag number' will be inserted as the second
     line of the shell script.

     For more information about the entire IRIX Interactive Desktop
     environment, see the IID(1) man page.

SEE ALSO
     The IRIX Interactive Desktop Integration Guide, fftr(1), launch(1),
     fm(1), IID(1), a.out(4), elf(4)


                                                                        Page 3