syntax error near unexpected token `

楊奇龍發表於2011-03-12
今天編寫了一個執行備份的指令碼,在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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-689280/,如需轉載,請註明出處,否則將追究法律責任。

相關文章