![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to debug a C++ code | ahjiefreak | High Level Programming | 0 | 04-06-2008 10:46 AM |
| debug aix 4.3 | itik | AIX | 2 | 10-29-2007 11:56 AM |
| how to debug | ramneek | High Level Programming | 1 | 09-19-2005 06:35 AM |
| How to debug a C program? | whatisthis | High Level Programming | 1 | 09-12-2005 09:33 PM |
| “Ostream” object is not printing message on HP-UNIX for debug mode | heena | UNIX for Advanced & Expert Users | 0 | 09-13-2004 05:08 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Yes. I have #! /bin/ksh at the begining of my program.
It's very interesting that I only get correct result when I run it with sh -x myprogram mode. It will give me this message: ========================= reaktime3[109]: 1690: not found breaktime3[109]: 900: not found breaktime3[109]: 1797: not found breaktime3[109]: 1791: not found ========================== This is my 109 line: =========================================== 109 /usr/ucb/echo "$intID" "$strNAME" "$intSHIFT" "`$intTotalPaidBreak|bc`" "$intTotalUnpaidBreak" >>/tmp/breaktime/REPORT.$$ ========================================= It's one line in shell. |
|
|||||
|
Realize that when you specify sh -x on the command line to execute your program, you are asking to run your script with the Bourne (sh) shell. However, the first line of your program specifies to run your script using the Korn (ksh) shell.
Why have you quoted each element individually? You dont need to do that. Use a single set of double quotes around the entire line. /usr/ucb/echo "$intID $strNAME $intSHIFT $($intTotalPaidBreak|bc) $intTotalUnpaidBreak" >>/tmp/breaktime/REPORT.$$ Also, try removing the space in your "magic number". Change #! /bin/ksh to #!/bin/ksh. While the syntax you are using for this should work, and is correct, not all systems support that method any longer. The HP system that I use at work doesnt like the space. Execute your file after making the changes. Also, below your #!/bin/ksh line, add the following line: set -x This will turn on debugging. You can now execute the shell without specifying ksh -x on the command line. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|