############################################################################### # # uxstd.dt # # Action and DataType definitions for standard operating system commands. # # (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company # (c) Copyright 1993, 1994, 1995 International Business Machines Corp. # (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. # (c) Copyright 1993, 1994, 1995 Novell, Inc. # # $Revision: 1.25 $ # ############################################################################### set DtDbVersion=1.0 ############################################################################### # # WARNING: This file may be overwritten in subsequent installations of # the Common Desktop Environment (CDE). Consequently, any system wide # changes should be made to an equivalent database file in # /etc/dt/types and not in this file. # ############################################################################### ############################################################################### # # Data Attributes # ############################################################################### DATA_ATTRIBUTES MAN_PAGE { ACTIONS Open,Print ICON Dtmanpg IS_TEXT true ACTIONS Open,Print MIME_TYPE text/plain DESCRIPTION This file contains a man page. Its data \ type is named MAN_PAGE. TYPE_LABEL MAN_PAGE } DATA_CRITERIA MAN_PAGE1 { DATA_ATTRIBUTES_NAME MAN_PAGE MODE f PATH_PATTERN */man/man*/*.[1-9]* } DATA_CRITERIA MAN_PAGE2 { DATA_ATTRIBUTES_NAME MAN_PAGE MODE f PATH_PATTERN */man/cat*/*.[1-9]* } ACTION Open { LABEL Open ARG_TYPE MAN_PAGE TYPE MAP MAP_ACTION Dtmanpageview } ACTION Print { LABEL Print ARG_TYPE MAN_PAGE TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /usr/dt/bin/dtlp -a "%Arg_1%" } ########################################################### DATA_ATTRIBUTES TAR { ACTIONS Open,TarUnpack,Print ICON Dtmagtp NAME_TEMPLATE %s.tar MIME_TYPE application/octet-stream DESCRIPTION This file is an archive file that contains \ a number of individual files. Its data type is \ named TAR. TAR files have names ending with '.tar'. TYPE_LABEL TAR } DATA_CRITERIA TAR1 { DATA_ATTRIBUTES_NAME TAR MODE f NAME_PATTERN *.tar } ACTION Open { LABEL Open ARG_TYPE TAR TYPE MAP MAP_ACTION TarList } ACTION Print { LABEL Print ARG_TYPE TAR TYPE MAP MAP_ACTION PrintTarList } ACTION TarList { LABEL Archive List Contents ICON Dtmagtp TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ tar -tvf "%(File)Arg_1%" 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Archive List Contents (TarList) action lists \ the files contained in a TAR archive file. } ACTION PrintTarList { LABEL PrintTarList TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING sh -c ' \ tar -tvf "%(File)Arg_1%" | \ /usr/dt/bin/dtlp -u "Archive List Contents"' DESCRIPTION The PrintTarList action prints out a list of the \ files contained in a TAR archive file on the \ default printer. } ACTION TarUnpack { LABEL Archive Unpack ICON Dtmagtp TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ tar -xvf "%(File)Arg_1"Filename:"%" \ 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Archive Unpack (TarUnpack) action accepts \ a TAR file as argument and separates out the \ archived files into separate files. } ########################################################### DATA_ATTRIBUTES COMPRESSED { ACTIONS Uncompress ICON Dtcmprs NAME_TEMPLATE %s.Z MIME_TYPE application/octet-stream SUNV3_TYPE compress DESCRIPTION This is a file that has been compressed by \ the compress command to take up less space. Its \ data type is named COMPRESSED. COMPRESSED files \ have names ending with '.Z'. TYPE_LABEL COMPRESSED } DATA_CRITERIA COMPRESSED1 { DATA_ATTRIBUTES_NAME COMPRESSED MODE f NAME_PATTERN *.Z } ACTION Print { LABEL Print ARG_TYPE COMPRESSED TYPE MAP MAP_ACTION NoPrint } ACTION Uncompress { LABEL Uncompress File TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ uncompress -vf "%(File)Arg_1%" %(File)Args% 2>&1 | \ \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Uncompress File action accepts one or more \ files that have been compressed using the \ 'compress' command and uncompresses them. It uses \ the 'uncompress' command. } ########################################################### DATA_ATTRIBUTES SHELL { ACTIONS Run,Open,Print ICON Dtbshll IS_EXECUTABLE true COPY_TO_ACTION Execute NAME_TEMPLATE %s.sh MIME_TYPE text/plain SUNV3_TYPE shell-script DESCRIPTION This file contains an executable script written \ using the BOURNE shell scripting language. Its \ data type is named SHELL. SHELL file have names \ ending with '.sh', or contain the characters \ "#!/bin/sh" or "#! /bin/sh". TYPE_LABEL SHELL } DATA_CRITERIA SHELL1 { DATA_ATTRIBUTES_NAME SHELL MODE f&x NAME_PATTERN *.sh } DATA_CRITERIA SHELL2 { DATA_ATTRIBUTES_NAME SHELL CONTENT 0 string #!/bin/sh MODE f&x } DATA_CRITERIA SHELL3 { DATA_ATTRIBUTES_NAME SHELL CONTENT 0 string #! /bin/sh MODE f&x } ACTION Run { LABEL Run ARG_TYPE SHELL TYPE MAP MAP_ACTION Execute } ########################################################### DATA_ATTRIBUTES CSHELL { ACTIONS Run,Open,Print ICON Dtcshll IS_EXECUTABLE true COPY_TO_ACTION Execute NAME_TEMPLATE %s.csh MIME_TYPE text/plain SUNV3_TYPE cshell-script DESCRIPTION This file contains an executable script \ written using the C-SHELL scripting language. \ Its data type is named CSHELL. CSHELL file have \ names ending with '.csh', or contain the \ characters "#!/bin/csh" or "#! /bin/csh". TYPE_LABEL CSHELL } DATA_CRITERIA CSHELL1 { DATA_ATTRIBUTES_NAME CSHELL MODE f&x NAME_PATTERN *.csh } DATA_CRITERIA CSHELL2 { DATA_ATTRIBUTES_NAME CSHELL CONTENT 0 string #!/bin/csh MODE f&x } DATA_CRITERIA CSHELL3 { DATA_ATTRIBUTES_NAME CSHELL CONTENT 0 string #! /bin/csh MODE f&x } ACTION Run { LABEL Run ARG_TYPE CSHELL TYPE MAP MAP_ACTION Execute } ########################################################### DATA_ATTRIBUTES KSHELL { ACTIONS Run,Open,Print ICON Dtkshll IS_EXECUTABLE true COPY_TO_ACTION Execute NAME_TEMPLATE %s.ksh MIME_TYPE text/plain DESCRIPTION This file contains an executable script \ written using the K-SHELL scripting language. \ Its data type is named KSHELL. KSHELL file have \ names ending with '.ksh', or contain the \ characters "#!/bin/ksh" or "#! /bin/ksh". TYPE_LABEL KSHELL } DATA_CRITERIA KSHELL1 { DATA_ATTRIBUTES_NAME KSHELL MODE f&x NAME_PATTERN *.ksh } DATA_CRITERIA KSHELL2 { DATA_ATTRIBUTES_NAME KSHELL CONTENT 0 string #!/bin/ksh MODE f&x } DATA_CRITERIA KSHELL3 { DATA_ATTRIBUTES_NAME KSHELL CONTENT 0 string #! /bin/ksh MODE f&x } ACTION Run { LABEL Run ARG_TYPE KSHELL TYPE MAP MAP_ACTION Execute } ########################################################### DATA_ATTRIBUTES SHAR { ACTIONS Unshar ICON Dtshar NAME_TEMPLATE %s.shar MIME_TYPE text/plain DESCRIPTION This file is a shell archive package. \ Shell archive packages are commonly used for \ mailing files. Its data type is named SHAR. \ SHAR files have names ending with '.shar'. TYPE_LABEL SHAR } DATA_CRITERIA SHAR1 { DATA_ATTRIBUTES_NAME SHAR MODE f NAME_PATTERN *.shar } ACTION Print { LABEL Print ARG_TYPE SHAR TYPE MAP MAP_ACTION NoPrint } ACTION Unshar { LABEL Unshar TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ sh "%(File)Arg_1%" 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Unshar action accepts a file \ that has been shar'ed using the shar \ command and unshar's it. } ########################################################### DATA_ATTRIBUTES UUENCODE { ACTIONS Uudecode ICON Dtuuncd NAME_TEMPLATE %s.uu MIME_TYPE text/plain DESCRIPTION This is a a binary file used for \ transmission via a mailer. Its data type is \ named UUENCODE. UUENCODE files have names ending \ with '.uu'. TYPE_LABEL UUENCODE } DATA_CRITERIA UUENCODE1 { DATA_ATTRIBUTES_NAME UUENCODE MODE f NAME_PATTERN *.uu } ACTION Print { LABEL Print ARG_TYPE UUENCODE TYPE MAP MAP_ACTION NoPrint } ACTION Uudecode { LABEL Uudecode TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ uudecode "%(File)Arg_1%" 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Uudecode action accepts a file \ that has been uuencoded using the uuencode command \ and uudecode's it. } ########################################################### DATA_ATTRIBUTES MESSAGE_CAT { ACTIONS (None) ICON Dtcat NAME_TEMPLATE %s.cat MIME_TYPE application/octet-stream DESCRIPTION This file contains localized message \ for an executable. Its data type is named \ MESSAGE_CAT. MESSAGE_CAT files have names ending \ with '.cat'. TYPE_LABEL MESSAGE_CAT } DATA_CRITERIA MESSAGE_CAT1 { DATA_ATTRIBUTES_NAME MESSAGE_CAT MODE f NAME_PATTERN *.cat } ACTION Print { LABEL Print ARG_TYPE MESSAGE_CAT TYPE MAP MAP_ACTION NoPrint } ############################################################################### ############################################################################### # # Actions # ############################################################################### ###################### # # Unix Editors # ###################### ACTION Vi { LABEL Text Editor (Vi) ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE TERMINAL EXEC_STRING vi DESCRIPTION The Text Editor (Vi) action runs the 'vi' \ command in a terminal window and loads a data file \ if you supply one. } ACTION Vi { LABEL Text Editor (Vi) TYPE COMMAND WINDOW_TYPE TERMINAL EXEC_STRING vi "%(File)Arg_1"File To Edit:"%" DESCRIPTION The Text Editor (Vi) action runs the 'vi' \ command in a terminal window and loads a data file \ if you supply one. } ####### ACTION Vedit { LABEL Vedit ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE TERMINAL EXEC_STRING vedit DESCRIPTION The Vedit action runs the 'vi' command in \ 'vedit' mode in a terminal window. It loads a data file if you supply one. } ACTION Vedit { LABEL Vedit TYPE COMMAND WINDOW_TYPE TERMINAL EXEC_STRING vedit "%(File)Arg_1"File To Edit:"%" DESCRIPTION The Vedit action runs the 'vi' command in \ 'vedit' mode in a terminal window. It loads a data file if you supply one. } ###################### # # Unix Commands # ###################### # The following action uses 'true %(File)Args%' in the EXEC_STRING. # This statement's only effect is to cause all of the aguments to # be 'used' on a single invocation of the action. ACTION Tar { LABEL Archive ICON Dtmagtp ARG_COUNT >1 TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING \ sh -c ' \ if [ "%(File)Args%" = "" ] ; then \ /usr/dt/bin/dterror.ds \ "The Archive action only accepts a single\\n \ argument which must be a folder." \ "Invalid Arguments" \ "OK" ; \ else \ true %(File)Args%; \ /usr/dt/bin/dterror.ds \ "The Archive action only accepts a single\\n \ argument which must be a folder." \ "Invalid Arguments" \ "OK" \ fi; ' DESCRIPTION The Archive (Tar) action accepts a folder \ argument and archives all of the files it contains \ together into a single "tar" file. It uses the \ 'tar' command. } ACTION Tar { LABEL Archive ICON Dtmagtp TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING \ sh -c ' \ if [ "%(File)Args%" = "" ] ; then \ echo "ERROR: %(File)Arg_1% is not a folder."; \ else \ if [ ! -d %(File)Arg_1"Folder To Archive:"% ] ; then \ echo "ERROR: %(File)Arg_1% is not a folder."; \ else \ FOLDER=%(File)Arg_1%.tar; \ TAR_FILE=`basename %(File)Arg_1%`.tar; \ echo "Creating \$FOLDER."; \ echo "[Please wait ...]\\n"; \ tar -cvf \$TAR_FILE `basename %(File)Arg_1%` 2>&1 | \ \${PAGER:-more}; \ echo "\\nThe Archive file has been created and is stored in \$FOLDER."; \ fi; \ fi; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Archive (Tar) action accepts a folder \ argument and archives all of the files it contains \ together into a single "tar" file. It uses the \ 'tar' command. } ####### ACTION TarList { LABEL Archive List Contents ICON Dtmagtp ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /usr/dt/bin/dtaction TarList \ %(File)Arg_1"Archive to List:"% DESCRIPTION The Archive List Contents (TarList) action lists \ the files contained in a TAR archive file. } ####### ACTION TarUnpack { LABEL Archive Unpack ICON Dtmagtp ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /usr/dt/bin/dtaction TarUnpack \ %(File)Arg_1"Archive to Unpack:"% DESCRIPTION The Archive Unpack (TarUnpack) action accepts \ a TAR file as argument and separates out the \ archived files into separate files. } ####### ACTION Compress { LABEL Compress File ICON Dtcmprs TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ compress -vf "%(File)Arg_1"File to Compress:"%" \ %(File)Args% 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Compress File (Compress) action accepts \ one or more files and compresses them using the \ 'compress' command. } ####### ACTION Uncompress { LABEL Uncompress File ICON Dtcmprs ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE NO_STDIO EXEC_STRING /usr/dt/bin/dtaction Uncompress \ "%(File)Arg_1"File to Uncompress:"%" DESCRIPTION The Uncompress File action accepts one or more \ files that have been compressed using the \ 'compress' command and uncompresses them. It uses \ the 'uncompress' command. } ####### ACTION Env { LABEL Environment Variables ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ env 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Environment Variables (Env) action \ displays the user's environment variables using \ the 'env' command. } ####### ACTION Diff { LABEL Compare Files TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ file1="%(File)Arg_1"First File (<):"%" ;\ file2="%(File)Arg_2"Second File (>):"%" ;\ cmp -s \$file1 \$file2 ;\ if [ \$? -eq 0 ] ; then \ echo "The files \$file1 and \$file2 are the same." ; \ else \ diff \$file1 \$file2 | \${PAGER:-more} ;\ fi ;\ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Compare Files (Diff) action compares two files \ using the 'diff' command. } ####### ACTION Rm { LABEL Shred File TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING \ sh -c ' \ echo "[Enter y to delete a file, n to leave it ...]\\n"; \ rm -i "%(File)Arg_1"File To Shred:"%" %(File)Args%; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Shred File (Rm) action uses the 'rm -i' command \ to remove files without placing them in the \ trash can. It prompts you with the name of \ each file and allows you to indicate whether \ or not the file should be removed. FILES THAT \ HAVE BEEN SHREDDED CANNOT BE RECOVERED. } ####### ACTION Wc { LABEL Count Words TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ (echo " lines words chars filename"; \ echo " ============================"; \ wc "%(File)Arg_1"File To Count:"%" %(File)Args%) 2>&1 | \ \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Count Words (Wc) action counts the lines, words, \ and characters in files. It uses the 'wc' command. } ####### ACTION Spell { LABEL Check Spelling TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING \ sh -c ' \ (echo "Misspelled words\\n================\\n"; \ spell "%(File)Arg_1"File To Spell Check:"%" %(File)Args%) 2>&1 | \ \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Check Spelling (Spell) action checks the \ spelling of all the words in a file. It uses the \ 'spell' command. } ####### ACTION Df { LABEL Disk Usage ARG_COUNT 0 TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING \ sh -c ' \ df 2>&1 | \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Disk Usage (Df) action displays the \ amount of free space available on all mounted \ disks. It uses the 'df' command. } ####### ACTION DuSort { LABEL Folder Size TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ if [ ! -d "%(File)Arg_1"Folder To Size:"%" ] ; then \ echo "ERROR: %(File)Arg_1% is not a folder."; \ else \ echo "[Please wait ...]\\n"; \ (echo "Blocks File/Dir - (Blocks are 512-bytes)"; \ echo "=========================================="; \ du -s "%(File)Arg_1"Folder To Size:"%" | sort -n) 2>&1 | \ \${PAGER:-more}; \ fi; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Folder Size (DuSort) action displays \ the size of each file and subfolder within a \ folder. It uses a combination of the 'du' \ and 'sort' commands. } ####### ACTION Grep { LABEL Search Text TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ SEARCH_FILE="%(File)Arg_1"File To Search:"%"; \ if [ -d \$SEARCH_FILE ] ; then \ echo "ERROR: \$SEARCH_FILE is a folder and the action\\nSearch Text does not search for strings within folders."; \ else \ grep %"Search String:"% \$SEARCH_FILE \ %(File)Args% >/tmp/dtstrsearch 2>&1; \ if [ \$? -eq 1 ] ; then \ echo "No matches were found."; \ else \ cat /tmp/dtstrsearch | \${PAGER:-more}; \ fi; \ rm /tmp/dtstrsearch; \ fi; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Search Text (Grep) action searches for \ all occurrences of a string within a set of files \ using the 'grep' command. } ####### ACTION File { LABEL Type File TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ file "%(File)Arg_1"File To Type:"%" %(File)Args% 2>&1 | \ \${PAGER:-more}; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Type File (File) action determines the \ type of a file using the file command. This is \ not the same as the desktop data type for the \ file. To determine the desktop data type of a \ file, select the file and choose the menu command \ Properties->File from a File Manager view. } ####### ACTION Execute { LABEL Execute TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING \ "%(File)Arg_1"File To Execute:"%" %"Options:"% %"Arguments:"% %(File)Args% DESCRIPTION The Execute action runs a shell script or \ binary executable. It prompts for options and \ arguments, and then executes the script or \ executable in a terminal window. } ####### ACTION ExecuteCmd { LABEL Execute Command TYPE COMMAND WINDOW_TYPE PERM_TERMINAL EXEC_STRING sh -c ' \ %"Command:"% %(File)Args%; \ echo "\\n*** Select Close or Exit from the window menu to close this window ***"' DESCRIPTION The Execute Command (ExecuteCmd) action \ prompts for a command and then executes it on any \ files that are supplied as arguments. } ########################### EOF ##############################################