Administrator Guide
1. When you run a script from a UNIX shell, first access the shell using the start shell command.
2. You are prompted to enter a user name and password configured with the username command.
For more information, refer to Creating a User Name and Password for Smart Scripting.
The following shows examples of how to execute a Perl, Python, and UNIX shell script directly from a
NetBSD shell on Dell Networking OS.
• The first bold line shows logging in to a UNIX shell.
• The second bold line lists the existing scripts.
• The third bold line executes the Perl script using either command
• The forth bold line executes the Python script using either command
Dell# start shell
4.4 BSD UNIX () (ttyp0)
login: admin
Password:
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.
$ cd /f10/flash/scripts
$ ls
createVlans.pl createVlans.py createVlans.sh
$ ./createVlans.pl 12 14
$ perl createVlans.pl 12 14
$ ./createVlans.py 12 14
$ python createVlans.py 12 14
$ ./createVlans.sh 12 14
Running Scripts with User Privileges
Use these scripts to administer any Expect, PERL, Python, Ruby, Tcl, UNIX and ZSH shell scripts stored on
the switch from the Dell Networking OS CLI.
To apply the associated read-write privileges while running a script from the Dell Networking OS CLI,
specify an optional username (refer to XXXCreating a User Name and Password for Smart Scripting). If
you do not specify a user name, the script runs with the privileges of the configured user.
To run a Perl, Python, Ruby or UNIX script from the Dell Networking OS CLI, use the script command.
Enter the script name and directory path to start the script. The script can invoke any of the supported
UNIX utilities listed in XXXSupported UNIX Utilities. Enter the command multiple times to run more than
one script at the same time.
• Run an installed script. For script-path, enter the directory path and filename.
CONFIGURATION mode
script [username name] script-path [script-parameter script-parameter ...]
For script-path, enter the directory path and filename.
(Optional) For username name, enter the user name whose read-write privileges are applied when
the script runs. A username running scripts cannot contain special characters.
Smart Scripting
91