Linux Shell Scripting – Functions

How do I create a shell script function using Bash under UNIX / Linux operating systems?

Functions are nothing but small subroutines or subscripts within a Bash shell script. You need to use to break up a complex script into separate tasks. This improves overall script readability and ease of use. However, shell function cannot return value. They return a status code.

All functions must be declared before they can be used.

function welcome(){
  Commands
}

OR

 
welcome(){
 Commands
 return $TRUE
}

You can call function by typing its name:

 
welcome

Read more

ntPHPselector : Bug fix #New Line entry error with AddHandler

Bug # New Line entry error with AddHandler

Description: If an htaccess file is not end with a new line the newly added “AddHandler” entry will be append to the end of the last line. The issue is occur with the .htaccess files eithout ending a newline (normally it ends with new line). The bug is fixed in the new version 2.0.4 by adding the AddHandler Entry as new Line. Since there is no major changes, no need to recompile, reinstall the ntphpselector plugin. The old users can fix this bug by running the following commands from root terminal.

Fix:

cd /usr/local/src
wget -N http://nixtree.com/download/free/ntphp/ntphp_patch204.sh
sh ntphp_patch204.sh

Read more

OpenSSL Heartbleed Bug

The Heartbleed Bug is a serious vulnerability in the popular OpenSSL cryptographic software library. This weakness allows stealing the information protected, under normal conditions, by the SSL/TLS encryption used to secure the Internet. SSL/TLS provides communication security and privacy over the Internet for applications such as web, email, instant messaging (IM) and some virtual private … Read more