Log In | Not a Member? | Support | |
SYNTAX
Choose name1 [name2]… ([-askpw] [-askvp] [-atalk] [-c]
[-guest] [-list] DESCRIPTION The Choose tool noninteractively mounts or lists (-list) the specified AppleShare volumes or printer. You can mount or list any number of volumes on a single command line, although a system-dependent limit exists on the number of active server connections; however, you can choose only one printer at a time, because only one print server can be active. The options that you can use with Choose depend on whether you are choosing file servers or a print server. The tool normally assumes that you are choosing file servers, but you can choose a print server instead by specifying -pr. (For details on specifying file server or printer names, see the name1 [name2]… parameter.) Table 1 lists the options that you can use for both file servers and print servers, those that you can use only with file servers, and those that you can use only with print servers. Table 1: File server and print server options
For servers and volumes with restricted access, you can either type your server and volume passwords on the command line (-pw or -vp) or request that a dialog box appear prompting you for passwords (-askpw or -askvp).
Note Choose can connect to file servers using TCP/IP or AppleTalk. If the -atalk option is not specified, Choose will check to see if the server supports AFP over TCP. If so, Choose will try connecting via TCP. If that fails or the server does not support TCP, Choose will connect via AppleTalk.
Note INPUT None OUTPUT None, unless you specify the -list, -v, -cp, or -p options. If you specify -list, Choose writes the names of existing zones, servers, and volumes to standard output. To list these names in the form of Choose commands, specify -c in conjunction with -list. You can also request that the names of all currently mounted volumes (-v) and the name, type, and driver of the currently mounted printer (-cp) be written to standard output. If you specify -p, version and progress information is written to diagnostic output. STATUS
Choose can return the following status codes:
PARAMETERS name1 [name2]… Specifies one or more AppleShare volumes or a printer (-pr), where name is a file server or print server name of the form: [zone]:[server[:volume]] If you omit the zone name, Choose defaults to the current zone; however, a server name must be preceded by at least a colon even if you do not specify the zone, as in this example: ':MobyDick:≈'
Note Servers can refer to either file or print servers, but volume names apply only to file servers. When mounting file server volumes, you must specify a server name. If you specify a volume name, only that volume is mounted. For example, 'WhaleZone:MobyDick:BigWhale' mounts the BigWhale volume on the MobyDick server in the zone WhaleZone. If you omit the volume name or if you substitute the ≈ wildcard character, Choose mounts all volumes in the specified server. For example, the following two command lines both mount all volumes on the MobyDick server.
'WhaleZone:MobyDick:'
Note OPTIONS -askpw Prompts for the file server password with a dialog box. Do not specify this option in conjunction with -pw or -guest. -askvp Prompts for the file server volume password with a dialog box. Do not specify this option in conjunction with -vp or -guest. -atalk Connects to file servers using AppleTalk instead of TCP/IP. -c Lists zones, servers, and volumes in the form of Choose commands when used in conjunction with -list. For example, the command line Choose -c -list might yield the output: Choose 'WhaleZone:MobyDick:BigWhale' Note that this option can be used with both file and print servers. -cp Writes the name, type, and driver of the currently mounted printer. If you specify this option, Choose provides the information before mounting any new printer. -dr driverName Specifies the driver name of the print server being mounted. This must name one of the printer drivers contained in the System Folder (such as 'LaserWriter'). -guest Logs in on the specified file server as a guest instead of a recognized user. -list Lists network zones, servers, and volumes in the form of quoted names. For example, 'WhaleZone:MobyDick:BigWhale' This option expands the next unspecified item in a name so that a zone name followed by nothing else expands to a list of servers in that zone, and a server name followed by nothing else expands to a list of volumes on the server.
Note Note that this option can be used for both file and print servers. -p Writes version and progress information to standard output. This includes the Choose tool's version number and step-by-step progress. This is particularly reassuring for listings that can take several minutes (for example, listing every server on a large network). Note that this option can be used for both file and print servers. -pr Specifies a print server rather than a file server. You must specify this option to choose (that is, mount or list) a print server. This option cannot be used when choosing file servers: You can choose a print server or one or more file servers, but not both. For a list of the options that can be used when choosing a print server, refer to Table 1. -pw password Specifies the file server password. Note that the server password defaults to the value of the MPW Shell variable {ServerPassword} and that all passwords are case sensitive.
Note -type typeName Overrides the default to choose or list a different type of file server volume or print server. Type names are not case sensitive. For volumes, the type name defaults to 'AFPServer'. For printers, it defaults to the name of the current printer driver (such as 'LaserWriter'). Use this option to mount or list network entities of other types (that is, not the 'AFPServer' or the current printer driver). A type name of ≈ or = matches all network entity types.
Note -u name Logs on to the file server with the specified user name. This option has precedence over the MPW Shell variable {User}, which in turn has precedence over the user name string in the system resource file ('STR' -16096). If the Chooser cannot find a valid user name at any of the above locations, -guest is assumed. -v Lists all mounted file server volumes. Colons are appended to each volume name. This is useful, for example, in writing Shell scripts in which volume names are not known ahead of time. -vp password Specifies the file server volume password. Note that the volume password defaults to the value of the MPW Shell variable {VolumePassword} and that all passwords are case sensitive.
Note EXAMPLES The following command line mounts the volume Sources on the server Linker, located in the current zone, using the default user name, and the default server and volume password. Choose :Linker:Sources Upon executing the following command line, Choose first mounts the volume Doc on the server Sources and every volume on the server Games in the zone Systems as a guest. It then prints the names of the currently mounted volumes (-v). Notice that the wildcard character is enclosed in quotation marks. Choose 'Systems:Sources:Doc' 'Systems:Games:≈' -v -guest The -askpw option prompts you for a server password with a dialog box. The following command line prompts you for your password for the Moby Dick file server before mounting it. Choose 'Whale Zone:Moby Dick:≈' -askpw Using -list in the following command line causes Choose to list all file servers in the zone Whale Zone, all volumes on the Moby Dick file server in that zone (after logging in with the default user name and server password), and all zones (with their servers). Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:' In the following script, the first command line lists all print servers in the current zone. The second command line prints the name of the currently mounted printer, and then mounts the printer called Kitchen Sink in the zone Zarf.
Choose -pr -list ':≈' By default, Choose allows you to mount file servers of type 'AFPServer'. Although you cannot mount servers of other types, you can list them. To list servers of type "Fortune Cookie" in all zones, you use the following command line: Choose '≈:≈' -list -type "Fortune Cookie" SEE ALSO
|