syntax error near unexpected token `
今天編寫了一個執行備份的指令碼,在ue裡面編寫,讓後傳遞到linux下,結果出現了syntax error near unexpected token ` 錯誤。網上的解決辦法是:
1)vi -b expdp_alibankdw_test.sh
2)在命令編輯行輸入:%s/^M//g
注意:上述命令列中的“^M”符,不是“^”再加上“M”,而是由“Ctrl+v+M”鍵生成的。
a.一些linux版本有 dos2unix 程式,可以用來祛除^M。
b.cat filename1 | tr -d "\r" > newfile 去掉^M生成一個新檔案,還有sed命令等,凡是可以替換的命令都是可以用來新生成一個檔案的。
oracle@rac1:rac1 /tmp/dump>sh expdp_alibankdw_test.sh
'xpdp_alibankdw_test.sh: line 13: syntax error near unexpected token `
'xpdp_alibankdw_test.sh: line 13: `expdp_alibank()
oracle@rac1:rac1 /tmp/dump>cat expdp_alibankdw_test.sh |tr -d "\r" > test.sh
oracle@rac1:rac1 /tmp/dump>sh test.sh
Begin export alibank's schemas .....
Export: Release 11.2.0.1.0 - Production on Sat Mar 12 19:20:12 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_FULL_01": "/******** AS SYSDBA" estimate_only=y full=y
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. estimated "CIF"."CIF_REF" 1024 KB
. estimated "CIF"."CIF_REF_EDUCATION" 1024 KB
. estimated "CIF"."CIF_REF_MARITAL" 1024 KB
. estimated "CIF"."CIF_REF_REL" 1024 KB
. estimated "CIF"."CIF_REF_SUBJECT" 1024 KB
. estimated "CIF"."CIF_SYNC_LOCK" 1024 KB
. estimated "CIF"."CIF_VALUE" 1024 KB
。。。。。。。。。。。。。。。。。。。
. estimated "SYSMAN"."MGMT_SYSTEM_PERFORMANCE_LOG" 576 KB
. estimated "APEX_030200"."WWV_FLOW_LIST_OF_VALUES_DATA" 512 KB
. estimated "SH"."PROMOTIONS" 512 KB
. estimated "SH"."TIMES" 512 KB
. estimated "SYSMAN"."MGMT_DB_INIT_PARAMS_ECM" 512 KB
. estimated "SYSMAN"."MGMT_ESA_REPORT" 512 KB
. estimated "SYSMAN"."MGMT_HC_OS_COMPONENTS" 512 KB
. estimated "SYSMAN"."MGMT_HC_VENDOR_SW_COMPONENTS" 512 KB
. estimated "SYSMAN"."MGMT_POLICY_ASSOC" 512 KB
. estimated "SYSMAN"."MGMT_POLICY_ASSOC_CFG" 512 KB
. estimated "APEX_030200"."WWV_FLOW_MESSAGES$" 448 KB
. estimated "APEX_030200"."WWV_FLOW_PAGE_PLUG_TEMPLATES" 448 KB
. estimated "APEX_030200"."WWV_FLOW_WORKSHEETS" 448 KB
. estimated "SYSMAN"."MGMT_HC_VENDOR_SW_SUMMARY" 448 KB
. estimated "PM"."TEXTDOCS_NESTEDTAB" 192 KB
. estimated "SH"."COSTS":"COSTS_Q1_1999" 192 KB
. estimated "SH"."COSTS":"COSTS_Q1_2001" 192 KB
. estimated "SH"."COSTS":"COSTS_Q2_2001" 192 KB
. estimated "SH"."COSTS":"COSTS_Q3_2001" 192 KB
1)vi -b expdp_alibankdw_test.sh
2)在命令編輯行輸入:%s/^M//g
注意:上述命令列中的“^M”符,不是“^”再加上“M”,而是由“Ctrl+v+M”鍵生成的。
a.一些linux版本有 dos2unix 程式,可以用來祛除^M。
b.cat filename1 | tr -d "\r" > newfile 去掉^M生成一個新檔案,還有sed命令等,凡是可以替換的命令都是可以用來新生成一個檔案的。
oracle@rac1:rac1 /tmp/dump>sh expdp_alibankdw_test.sh
'xpdp_alibankdw_test.sh: line 13: syntax error near unexpected token `
'xpdp_alibankdw_test.sh: line 13: `expdp_alibank()
oracle@rac1:rac1 /tmp/dump>cat expdp_alibankdw_test.sh |tr -d "\r" > test.sh
oracle@rac1:rac1 /tmp/dump>sh test.sh
Begin export alibank's schemas .....
Export: Release 11.2.0.1.0 - Production on Sat Mar 12 19:20:12 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_FULL_01": "/******** AS SYSDBA" estimate_only=y full=y
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. estimated "CIF"."CIF_REF" 1024 KB
. estimated "CIF"."CIF_REF_EDUCATION" 1024 KB
. estimated "CIF"."CIF_REF_MARITAL" 1024 KB
. estimated "CIF"."CIF_REF_REL" 1024 KB
. estimated "CIF"."CIF_REF_SUBJECT" 1024 KB
. estimated "CIF"."CIF_SYNC_LOCK" 1024 KB
. estimated "CIF"."CIF_VALUE" 1024 KB
。。。。。。。。。。。。。。。。。。。
. estimated "SYSMAN"."MGMT_SYSTEM_PERFORMANCE_LOG" 576 KB
. estimated "APEX_030200"."WWV_FLOW_LIST_OF_VALUES_DATA" 512 KB
. estimated "SH"."PROMOTIONS" 512 KB
. estimated "SH"."TIMES" 512 KB
. estimated "SYSMAN"."MGMT_DB_INIT_PARAMS_ECM" 512 KB
. estimated "SYSMAN"."MGMT_ESA_REPORT" 512 KB
. estimated "SYSMAN"."MGMT_HC_OS_COMPONENTS" 512 KB
. estimated "SYSMAN"."MGMT_HC_VENDOR_SW_COMPONENTS" 512 KB
. estimated "SYSMAN"."MGMT_POLICY_ASSOC" 512 KB
. estimated "SYSMAN"."MGMT_POLICY_ASSOC_CFG" 512 KB
. estimated "APEX_030200"."WWV_FLOW_MESSAGES$" 448 KB
. estimated "APEX_030200"."WWV_FLOW_PAGE_PLUG_TEMPLATES" 448 KB
. estimated "APEX_030200"."WWV_FLOW_WORKSHEETS" 448 KB
. estimated "SYSMAN"."MGMT_HC_VENDOR_SW_SUMMARY" 448 KB
. estimated "PM"."TEXTDOCS_NESTEDTAB" 192 KB
. estimated "SH"."COSTS":"COSTS_Q1_1999" 192 KB
. estimated "SH"."COSTS":"COSTS_Q1_2001" 192 KB
. estimated "SH"."COSTS":"COSTS_Q2_2001" 192 KB
. estimated "SH"."COSTS":"COSTS_Q3_2001" 192 KB
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-689280/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- syntax error near unexpected token `問題的解決Error
- shell 指令碼報錯^M: syntax error near unexpected token指令碼Error
- CentOS7使用exp/imp時報錯:bash: syntax error near unexpected token `(CentOSError
- Linux 5中出現的-bash: syntax error near unexpected token `('錯誤LinuxError
- Solaris syntax error: unexpected end of fileError
- line 10:syntax error: unexpected end of fileError
- 配置NDK syntax error: unexpected end of file 解決Error
- Solaris awk: syntax error near line 1 awk: bailing out near line 1ErrorAI
- npm ERR! Unexpected token in JSON at position 0 while parsing near ’ npm ERR! <!–////////NPMJSONWhile
- 360 Atals:Cause: java.sql.SQLException: Proxy Warning - near “status“: syntax errorJavaSQLExceptionError
- 解決 eslint 的 Parsing error: Unexpected token 錯誤EsLintError
- pecl PHP Parse error: syntax error, unexpected 'new' (T_NEW) 以及 XML缺失解決辦法PHPErrorXML
- Laravel 8使用 佇列任務出現 「 syntax error, unexpected ')' 」錯誤解決Laravel佇列Error
- Uncaught SyntaxError: Unexpected token <反思Error
- eclipse 引入外部js檔案報Syntax error on token 錯解決方案EclipseJSError
- PbootCMS 升級後網站打不開,解析錯誤 Parse error: syntax error, unexpected ‘:’, expecting ‘{’怎麼辦boot網站Error
- 如何解決"Parse error: syntax error"Error
- 完美解決 Uncaught SyntaxError: Unexpected token ‘<‘Error
- jquery Ajax 請求錯誤 Unexpected tokenjQuery
- npm 安裝 uirecorder 報錯 Unexpected tokenNPMUI
- Syntax error, unrecognized expression: li[value=]ErrorZedExpress
- exp tables sh: Syntax error: `(' is not expectedError
- 【shell 】syntax error in conditional expressionErrorExpress
- npm install “Unexpected end of JSON input while parsing near”問題NPMJSONWhile
- webpack打包vue檔案時報錯`Unexpected token:`WebVue
- MySQL 報錯MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'MySqlServerMIT
- Oracle安裝報錯syntax errorOracleError
- 帝國CMS提示parse error syntax error的解決方法Error
- oparsererror 200-SyntaxError: Unexpected token < in JSON at position 0ErrorJSON
- JN專案-Hibernate報錯unexpected token: select
- jquery $.ajax SyntaxError: invalid label /Uncaught SyntaxError: Unexpected token :jQueryError
- ScalaSigParserError: Unexpected error: Not a valid class fileError
- error unexpected trailing commaErrorAI
- npm install 出現 npm ERR! Unexpected end of JSON input while parsing near '...ostNPMJSONWhile
- 如何解決"You have an error in your SQL syntax"ErrorSQL
- bug集合js1–Unexpected token o in JSON at position 1JSON
- StringRedisTemplate操作Redis時拋: Unexpected token (VALUE_STRING)Redis
- Uncaught SyntaxError: Unexpected token : 開發遇到的跨域問題Error跨域