Solve special character when merge files by shell script
Problem encountered
When using jenkins merge the SQL scripts in Ubuntu server, the result of the sql file contains special character like below
With this special character, the sqlplus not able run the script normally which report error
1 |
|
Solution
The porblme caused by utf8 file contains the bom \xEF,\xBB,\xBF, it is cause the result contains special character after sed or cat files.
We can use sed to remove replace the bom to empty for the file
1 |
|
Or use grep to find all files (include sub folders) with utf8 bom and replace the bom to empty
1 |
|