![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Problem with Shell Script. | pektl | Shell Programming and Scripting | 7 | 05-29-2006 02:08 AM |
| Problem with SU or SSH in shell script | sravanp | UNIX for Dummies Questions & Answers | 2 | 01-24-2006 08:00 AM |
| Shell Script problem | bnohifi | Shell Programming and Scripting | 1 | 07-06-2005 11:02 PM |
| Problem with shell script | zylwyz | Shell Programming and Scripting | 2 | 06-29-2005 10:01 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Problem In Shell Script
Hi,
I'm new to Shell script. Can anyone tell me where is the wrong in my code? And, my code is -- Code:
echo "Enter Start Date(YYYY-MM-DD): " read stdt echo "Enter End Date(YYYY-MM-DD): " read endt echo "Enter Flight Number(Optional): " read fln echo "Enter Output XML File Name(Including Extension): " read dst #if [ $fln eq "" ] then #if [ "$fln" = "" ] then if [ $? -lt 3 ] then java DailyScheduleExport $stdt $endt> $dst else java DailyScheduleExport $stdt $endt $fln> $dst fi And the error is -- Code:
ods@awhq6640[/prod/ods/sqlj/ods_services]>sh DailyScheduleExport_q.ksh DailyScheduleExport_q.ksh[2]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[4]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[6]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[8]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[9]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[12]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[13]: ^M: Execute permission denied. Enter Start Date(YYYY-MM-DD): 2007-01-01 DailyScheduleExport_q.ksh[16]: ^M: This is not an identifier. DailyScheduleExport_q.ksh[17]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[18]: ^M: Execute permission denied. Enter End Date(YYYY-MM-DD): 2007-09-21 DailyScheduleExport_q.ksh[20]: ^M: This is not an identifier. DailyScheduleExport_q.ksh[21]: ^M: Execute permission denied. Enter Flight Number(Optional): DailyScheduleExport_q.ksh[23]: fln^M: This is not an identifier. DailyScheduleExport_q.ksh[24]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[25]: ^M: Execute permission denied. Enter Output XML File Name(Including Extension): DailyScheduleExport_q.ksh[27]: dst^M: This is not an identifier. DailyScheduleExport_q.ksh[28]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[31]: ^M: Execute permission denied. DailyScheduleExport_q.ksh[32]: Syntax error at line 32 : `if' is not matched. ods@awhq6640[/prod/ods/sqlj/ods_services]> Code:
-rwxrwxrwx 1 ods ods 800 Sep 24 06:28 DailyScheduleExport_q.ksh Regards. Satyaki De. |
| Forum Sponsor | ||
|
|
|
|||
|
Hi thanks for your reply. But, it is showing error message --
Code:
ods@awhq6640[/prod/ods/sqlj/ods_services]>tput clear ods@awhq6640[/prod/ods/sqlj/ods_services]>head -1 DailyScheduleExport_q.ksh | od -a od: illegal option -- a Usage: od [-v] [-A base] [-j skip] [-N count] [-t type_string]... [file...] ods@awhq6640[/prod/ods/sqlj/ods_services]> Code:
#!/usr/bin/ksh Satyaki De. |
|
|||
|
Hi,
Looks like you may have extraneous "Control-M" characters in your file. Open it in vi to see. This occurs sometimes when porting a DOS/Windows file to Unix. You can delete them one by one or run the command: dos2unix. If your OS doesn't have this command look for one by typing: man -k dos. Hope this helps, John |
|
||||
|
Quote:
Code:
dos2ux DailyScheduleExport_q.ksh |
||||
| Google UNIX.COM |