000027939 - KB-1488 Why do I get bash print error when applying hotfix?

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000027939
Applies ToAffected Versions: 3.6.X
CauseThese errors are a result of how the user interprets the direction 'run hf.sh'. A complete description is provided below.
Resolution

For 3.6.x


=======


 


The README.Txt file for Aveksa 3.6.x HotFixes, says to do these last three actions as the root user, to install a 3.6.x HotFix:



6) chmod 777 hf.sh
7) dos2unix hf.sh
8) run hf.sh



Line items #6 and #7 are actual Linux commands, but item #8, 'run' is not an UNIX command. What is meant by 'run' is that the shell script hf.sh needs to be will be 'executed' (ie 'run') to complete the hotfix installation.


 


The simplest way to execute a script, once the file permissions have been set (whch is done via the chmod 777), is to simply enter the script name at the $ prompt. For example: $ hf.sh


 


 


This works as long as the local directory is included in the users PATH environment variable. You can also 'source' the script file (which means to directly indicate its path), by including a ./ before the script name.


For example: $ ./hf.sh


 


Both of these methods work and are appropriate for Aveksa 3.6.x HotFixes.


 


 


Some UNIX references the 'need' for the 'dot operator (.)', to execute or run a script. The syntax is a dot (period), followed by a space, and followed by a shell scriptname.


 


Examples of this would be:


 


$ . hf.sh


or


$ . ./hf.sh


 


 


Why would you use the dot operator?
Normally, when you run a shell script, it executes in a child shell. Once the script completes, the child shell goes away and you are returned to the command prompt on the original shell. This means that the scope of the script doesn't apply to the invoking shell.
In other words, if your script changed the directory or set some variables, those changes won't be reflected after the script ends.
Using a dot space in front of the script means that the scope of the script is the same as the invoking shell.
For example, let's say that you are currently in the /usr directory and you run the script go_tmp, which changes the directory to /tmp.
If you run go_tmp then, after the script ends, you will still be in /usr.
If you run . go_tmp, then you will be in /tmp after it runs.


 


Application of Aveksa HotFixes do NOT require and do NOT expect the use of the 'dot operator' when executing hf.sh. In fact, if it is used, the following errors are seen, and then after step 5, the user is prompted to verify copying or moving of every file in the hotfix:


 


 


[root@vm-support-04 HF17]# . hf.sh


bash: print: command not found


bash: print: command not found


 


.


.


.


Step 5. Apply changes.


-----------------------------------------------------------------


 


tar: Removing leading `/' from member names


cp: overwrite '/usr/bin/apache-tomcat-5.5.12/webapps/aveksa/FileSystemACLCollector1/collector.xml'?


 


For 4.x


======


Note that this is not an issue for 4.x HotFixes, as the README.txt has been updated and the reference to execute hf.sh has been changed from 'run hf.sh' to 'sh hf.sh'. (run is NOT an UNIX command, sh is).

Attachments

    Outcomes