|
January 2004 OverviewThe scriptran utility scans your shell scripts and reports compatibility issues caused by differences between Linux and the Solaris OS. Passing shell scripts through the scriptran filter can identify most issues. How Scriptran WorksScriptran scans Bourne shell scripts looking for calls to system commands. Each command is checked for the following conditions:
Guide to Using ScriptranTo invoke scriptran, go to the directory containing the scripts to be scanned, then type: scriptran [options] [filename] The options are: --verbose (Get detailed messages.) --show-all-commands (Show all commands in the shell script -- even those that do not have any issues.) --show-always (Some shell commands do not have an issue unless specific command line-options are used. By default, scriptran does not report an issue for these commands, unless these options are used. Specifying the --show-always option causes scriptran to report these issues anyway.) --help | --flags (Display usage information.) If file name is omitted, scriptran runs in interactive mode. Using Scriptran in BatchThe scriptran utility is normally used in batch mode. In this mode, scriptran loads the specified file and looks for compatibility issues. scriptran filename If the command is found in the issues database, the command is flagged. The output which is sent to Interactive ModeInteractive mode lets you check commands as you type them. This is handy if you want to know if there are any porting issues for a specific command. Here is a sample interactive session: % scriptran scriptran-cmd (ctrl-d quits) >cat scriptran:1 *** SCRIPT ISSUE (cat) *** Issue: cat (1) - concatenate files and print on the standard output cat on Solaris does NOT have these options: -s (different meaning) -A -E (using -e) -T and options preceded with -- *** END ISSUE *** scriptran-cmd (ctrl-d quits) >^D % (To end the session, press <Ctrl+d>.) Common Issues and WorkaroundsHere is a list of the most common issues: Variables are not assigned, so the following will produce a "command not found" error: $ BIN=/usr/bin $ $BIN/echo The line number produced is incorrect for lines such as the following that contain sub-shell processing: $ PROCESSES=`ps -ef | grep -v $USER' | |||
|
| ||||||||||||