| ## uuidgen(1rpc) Generates a Universal Unique Identifier (UUID) Synopsis uuidgen [argument] ... Arguments -c Allows you to supply an existing UUID that uuidgen then outputs in the format you specify. This option is especially useful in combination with the -s option for converting an existing UUID into a C structure. You must specify the -c option at the end of the uuidgen command line; all options that follow -c are ignored. -i Produces an Interface Definition Language (IDL) file template and includes the generated UUID string in the template. -o filename Redirects the generated UUID string to the file you specify. -s Generates a UUID string as an initialized C structure. -v Displays the version number of the UUID generator, but does not generate a UUID. -h Displays information about the uuidgen command arguments. The arguments -h and -? can be used interchangeably. -? Displays information about the uuidgen command arguments. The arguments -? and -h can be used interchangeably. -n number_of_uuid_strings Generates a specified number of UUID strings. Description The uuidgen command creates a UUID string that you assign to an object to uniquely identify it. One such use is in the UUID interface attribute of an IDL interface definition. The format for representing a UUID string consists of eight hexadecimal digits followed by a dash, followed by three groups of four hexadecimal digits separated by dashes, followed by a dash and twelve hexadecimal digits: 01234567-89ab-cdef-0123-456789abcdef Examples 1. Generate a UUID string with the following command: uuidgen This results in output like the following: 23c67e00-71b6-11c9-9dfc-08002b0ecef1 2. Generate a partial template, containing a generated UUID string, to be used to develop an interface definition, with the following command: uuidgen -I This results in output like the following: [ uuid(828bf780-71b6-11c9-b5a8-08002b0ecef1), version (1.0) ] interface INTERFACENAME { } 3. Convert a UUID string from the old-style format to the new format with the following command: uuidgen -t 34DC23469EAF.AB.A2.01.7C.5F.2C.ED.A3 This results in output like the following: 34dc2346-9eaf-0000-aba2-017c5f2ceda3 4. Generate four UUID strings with the following command: uuidgen -n 4 This results in output like the following: 612c0b00-71b8-11c9-973a-08002b0ecef1 612c0b01-71b8-11c9-973a-08002b0ecef1 612c0b02-71b8-11c9-973a-08002b0ecef1 612c0b03-71b8-11c9-973a-08002b0ecef1 5. Convert a UUID into a C structure with the following command: uuidgen -s -c 1251ace6-93al-11cd-95ad-0800097086e4 This results in output like the following: = { /* 1251ace6-93al-11cd-95ad-0800097086e4 */ 0x1251ace6, 0x93al, 0x11cd, 0x95, 0xad {0x08, 0x00, 0x09, 0x70, 0x86, 0xe4} }; Errors A representative list of errors that might be returned is not shown here. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages. Files The locations of files have the following pathnames: \dceshared/bin/uuidgen Generator \dceshared/nls/msg/\LANG/uuidgen.cat Generator error messages ##