If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Is there a way to turn on line#'s on unix debug?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-10, 10:40
ncsthbell ncsthbell is offline
Registered User
 
Join Date: Aug 2010
Posts: 13
Is there a way to turn on line#'s on unix debug?

I am using: ksh -nx ./test_IT.sh to debug my script. It returns a line that says '' ' is not expected. 403-057 Syntax error at line 32: ".

Then is use VI to look at the script. Is there anyway I can set some option so I can see which line is line # 32. I have a lot of 'echo' statements in my script so it is very difficult to tell which line it is pointing to.

THanks!
Reply With Quote
  #2 (permalink)  
Old 10-05-10, 15:50
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Colon-it...

Quote:
Originally Posted by ncsthbell View Post
I am using: ksh -nx ./test_IT.sh to debug my script. It returns a line that says '' ' is not expected. 403-057 Syntax error at line 32: ".

Then is use VI to look at the script. Is there anyway I can set some option so I can see which line is line # 32. I have a lot of 'echo' statements in my script so it is very difficult to tell which line it is pointing to.

THanks!
In vi, type colon ( : ) and the line number. The cursor will go to that line.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 10-05-10, 19:59
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 629
or in vi do:
<esc>:set number
to turn line numbering on.
and
<esc>:set nonumber
to turn line numbering off.

Or depending upon the OS and whether you are using vi or vim, you can set line numbering on in ~/.exrc or ~/.vimrc .
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On