Commands for Text File Usage

The following commands are for text file usage:

  • #

  • @

  • DISPLAY

  • EXIT

  • FDISPLAY

  • TERM

  • WRITE

Each of these commands is covered in detail in the following sections.

The # Symbol

The # symbol executes a program that is external to the login script and waits until it is finished running before continuing with other login script commands.

 
 # [  path  ]  filename  [  parameter  ] 

Replace path with a drive letter. Replace filename with the executable file. It isn't necessary to include the extension, but doing so can speed up the execution of the external program. Replace parameter with any parameters required by the executable file.

TIP

Use the @ command, described in the following section, instead of the # command if an external program will remain open for any length of time. Otherwise, the login script will remain "open" until the external program closes (login scripts cannot be edited when they are held open ).


The @ Command

The @ command executes a program that is external to the login script and then continues with the script (similar to the Startup group in Windows).

 
 @ [  path  ]  filename  [  parameter  ] 

Replace path with a drive letter. Replace filename with an executable. Do not include the extension. Replace parameter with any parameters required by the executable file. For example, if you want to start the GroupWise program from within the login script, use the following command:

 
 @SYS:\APPS\GROUPWISE\GRPWISE 

DISPLAY

DISPLAY shows the contents of a text file when the user logs in. All characters in the file, including any printer and word processing codes, appear.

 
 DISPLAY [  path  ]  filename  

Replace path with either a drive letter or a full directory path beginning with the volume name . Replace filename with the complete name (including the extension) of the file you want to display. For example, you can put messages in a file SYS:PUBLIC\MESSGES\NEWS.TXT . To have the messages shown to users when they log in on Monday, add the following lines to the container login script:

 
 IF DAY_OF_WEEK=" Monday"  THEN   DISPLAY SYS:PUBLIC\MESSAGES\NEWS.TXT END 

EXIT

Use EXIT to terminate execution of the login script.

WARNING

You cannot use EXIT in a login script to stop the login script and execute a program. EXIT only terminates the execution of the login script. If you want to execute a program after exiting the login script, use # or @ followed on the next line by EXIT .


FDISPLAY

FDISPLAY shows the text of a word processing file when the user logs in. When you use FDISPLAY to display a word processing file, the text is filtered and formatted so that only the text is displayed.

 
 FDISPLAY [  path  ]  filename  

Replace path with either a drive letter or a full directory path beginning with the volume name. Replace filename with the complete name (including the extension) of the file you want to display. For example, you can put messages in a file SYS:PUBLIC\MESSGES\NEWS.DOC . To have the messages shown to users when they log in on Monday, add the following lines to the container login script:

 
 IF DAY_OF_WEEK=" Monday"  THEN   FDISPLAY SYS:PUBLIC\MESSAGES\NEWS.DOC END 

TERM

TERM is normally used only for Application Launcher scripts, a component of Novell ZEN for Desktops (ZfD). Use the TERM command in a login script to stop the login script and return an error code. You can also use TERM in an IF...THEN statement, so that the login script stops and an error code is returned only if a condition is true (that is, if a certain condition exists). If the condition doesn't occur the login script skips the TERM command and continues executing.

WARNING

Because TERM stops the login script, be sure to put this command either at the end of the login script or at a point within the script where you intend execution to stop. Do not nest the TERM command in the login script. If you add TERM to a container login script, it prevents other profile or user login scripts from running. If you put TERM in a profile login script, it prevents the user login script from running.


WRITE

WRITE displays messages on the workstation screen when a user logs in to the network. Text you want to display must be enclosed in quotation marks (" ").

There are several ways to display variables in the text message. The way you enter the variable in the WRITE command determines the display format, as follows :

  • To simply display the variable value onscreen, type the identifier variable with no accompanying punctuation.

  • To combine regular text with an identifier variable, precede the variable with a percent sign ( % ), type it in uppercase letters , and enclose the identifier variable inside quotation marks. Both text and the variable can be enclosed in the same quotation marks.

  • To join several text strings and identifier variables into a single display without enclosing the variables in quotation marks, use a semicolon between the text and the variables.

  • If you have several WRITE commands, each one appears on a separate line on the user's workstation. However, if you put a semicolon at the end of all but the last WRITE commands, the commands all appear as one continuous sentence or paragraph (although they might wrap onto additional lines on the workstation's screen).

Text strings can include the following special characters:

  • \r Causes a carriage return

  • \n Starts a new line of text

  • \" Displays a quotation mark on the screen

  • \7 Makes a beep sound

In addition to the semicolon, you can use other operators to join text and identifier variables into one command. These operators are listed in order of precedence:

  • * / % Multiply, divide, modulo

  • + - Add, subtract

  • >> << Shift left or right ( 1000 >> 3 becomes 1 )

For example:

 
 WRITE "[  text  ][%  identifier  ] [;][  identifier  ]" 

Replace text with the words you want to display on the screen. Replace identifier with a variable you want to display. For example, to display the message "Hello," along with the user's last name, add the following line to the login script:

 
 WRITE "Hello, ;%LAST_NAME" 

To make a beep sound occur while the phrase "Good morning" appears on the screen, add the following line to the login script:

 
 WRITE "Good %GREETING_TIME " 


Novell NetWare 6. 5 Administrator's Handbook
Novell NetWare 6.5 Administrators Handbook
ISBN: 0789729849
EAN: 2147483647
Year: 2002
Pages: 172

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net