script debugging

is there any way you can add a breakpoint in a script so you can stop on it?

i have used -xv in my shebang but the script just runs and i want it to stop at a specific point in the script.
appreciate any help.

Hi.

Not with any builtin that I know of. The book below presents a script that allows breakpoints. You can download the code from Index of /bash2 , but you may need the support of the book. It's possible that you may be able to find Edition 2 used for an attractive price.

O'Reilly published a similar book on the Korn shell; code at Index of /korn2

Best wishes ... cheers, drl

Title: Learning the bash Shell
Author: Cameron Newham
Edition: Third
Date: 2005
Publisher: O'Reilly
ISBN: 0596009658
Pages: 376
Categories: bash, scripting, unix, linux, shell, programming
Comments: 4 stars, 27 reviews (Amazon 2007.08)
Comments: ( I have 2nd edition, 1998)
Comments: "bashdb", bash debugger, Chapter 9.