000037166 - RSA NetWitness sasftpagent.sh script fails with "bad substitution" on Solaris 10/11

Document created by RSA Customer Support Employee on Mar 27, 2019Last modified by RSA Customer Support Employee on Mar 27, 2019
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000037166
Applies ToRSA Product Set: NetWitness Logs & Network
RSA Product/Service Type: Core Appliance
RSA Version/Condition: 10.6.x, 11.x
Platform: Solaris
O/S Version: 10 and 11
Product Name: sasftpagent.sh
IssueWhen running the NetWitness Logs and Networks sasftpagent.sh script version 3.0.1, it fails returning this error "bad substitution" on Solaris 10 and Solaris 11.
 


# ./sasftpagent.sh
./sasftpagent.sh: bad substitution

 


# uname -a
SunOS cauctauth1 5.10 Generic_147440-12 sun4v sparc sun4v

CauseThe Solaris /usr/bin/sh is strict about the POSIX compliance version it will allow.

The sasftpagent.sh script version 3.0.1 uses some commands and shell syntax for a different POSIX standard that is not available in Solaris /usr/bin/sh.

Solaris has other versions of the commands and shell under a different path which will work with the sasftpagent.sh script.
ResolutionChange the first line of the sasftpagent.sh script version 3.0.1 from,
 

#!/bin/sh


to be the following two lines,
 

#!/usr/bin/bash
PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/opt/csw/bin:$PATH
WorkaroundAnother available work-around is to use the older version 2.7.10 sasftpagent.sh script (see attached below), which does work on Solaris 10/11.
NotesOther errors may be observed when running the sasftpagent.sh script.
  1. The sasftpagent.sh script fails with errors,
     
    id: illegal option -- u
    Usage: id [-ap] [user]


    and
    awk: syntax error near line 2
    awk: illegal statement near line 2
    awk: syntax error near line 3
    awk: illegal statement near line 3


    This indicates the alternate path "/usr/xpg4/bin" to the commands "id" and "awk" is missing or incorrect.
    Check that the PATH environment variable is correctly set for this directory in sasftpagent.sh script.
     
  2. The sasftpagent.sh script fails with errors,
     
    2019-02-06 12:09:40 ERROR stderr: Connecting to 10.62.31.57...
    2019-02-06 12:09:40 ERROR stderr: no kex alg
    2019-02-06 12:09:40 ERROR stderr: Connection closed


    This indicates the alternate path "/opt/csw/bin" to the command "sftp" is missing or incorrect.
    Check the PATH environment variable is correctly set for this directory in the sasftpagent.sh script.
 

Attachments

Outcomes