Bin log Script Error

Document ID : KB000076791
Last Modified Date : 09/04/2018
Show Technical Document Details
Issue:
Binlog script fails with similar error

Gateway#sh manage_binlogs.sh -f
: command not foundline 127:
: command not foundline 129:
: command not foundline 138:
: command not foundline 144:
: command not foundline 147:
: command not foundline 153:
: command not foundline 161:
: command not foundline 165:
: command not foundline 170:
: command not foundline 174:
: command not foundline 176:
'anage_binlogs.sh: line 177: syntax error near unexpected token `{
'anage_binlogs.sh: line 177: `clean_up() {

 
Environment:
All versions of Gateway
Cause:
These errors are usually due to incorrect line terminators in a script i.e. DOS CR/LF versus Unix LF.
Resolution:
It is possible to convert the file to use correct UNIX terminators by using the Dos2Unix command (either d2u or dos2unix). The line terminator problem is usually caused by saving the script in a Windows file editor.