hive run script format error solution

Type the command in Xshell: sh friendpage.sh

The system prompts an error:

'riendpage.sh: line 4: synt ax error near unexpected token `{

'riendpage.sh: line 4: `function main(){

solution:

1. It may be because the newline character of the processed file is "\r\n" in dos format;

2. Use cat -v file name to see if the newline is true, if it is the above, the line ending will be ^m  which needs to be converted to "\n" in linux/unix format

Open the friendpage.sh text with EverEdit and edit it. When saving, the encoding is generally in PC format by default, and it needs to be changed to Unix format!

3. Re-run to solve the above error!


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325713739&siteId=291194637