- 论坛徽章:
- 0
|
请教第一问:为什么执行的时候有以下提示?但是SQL执行是成功的。
[root@RIS02 itps]# ./test.sh
: No such file or directory
: command not found
Hello, Drewlee
Now we will log in MySQL......
: command not found
已经生成文件output_20040807.txt?
怎么把文件后的'?'去掉?实际字串是'\r'。
脚本文件test.sh:
!/bin/sh
echo 'Hello, Drewlee'
echo 'Now we will log in MySQL......'
mysql gecris < /home/itps/testsql.sql > /home/itps/output_`date "+%Y%m%d"`.txt
脚本文件testsql.sql
use gecris;
select p.PatientNameEnglish, p.PatientIntraID, e.ExamAccessionID, e.ExamType,e.E
xamSatus, e.PostExamReporterName, e.PostExamReportDate from PatientInfo p, ExamI
nfo e where e.ExamSatus = '已检查' and e.StudyInstanceUID != '' and e.PostExamRe
porterName != '' and e.PostExamReportDate != '' and p.PatientIntraID = e.Patient
IntraID;
update ExamInfo e set e.ExamSatus='已报告' where e.ExamSatus = '已检查' and e.St
udyInstanceUID != '' and e.PostExamReporterName != '' and e.PostExamReportDate !
= '';
请教第二问:怎么作串变量的追加运算?
如:
B='my'
C='god'
A=B+C 希望A='my god' |
|