- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Debug script shell ( posix )
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2000 10:00 AM
тАО10-31-2000 10:00 AM
I don?t remember how debug script or trace all the task of script
thanks
Paulo
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2000 10:11 AM
тАО10-31-2000 10:11 AM
Re: Debug script shell ( posix )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2000 10:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2000 10:21 AM
тАО10-31-2000 10:21 AM
Re: Debug script shell ( posix )
You can also just set the -x on the first line that specifies your shell:
#!/usr/bin/ksh -x
-Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-01-2000 12:23 AM
тАО11-01-2000 12:23 AM
Re: Debug script shell ( posix )
what the others wrote is really the usual way to do something what comes anyway close to debugging as far as shell scripts are concerned.
Actually I prefer piping stdout and stderr directly into more
$ sh -v -x myscript.sh 2>&1 | more
Apart from this you can do it the old Fortran way (before the advent of debuggers)
in spreading echo and read statements in your code to mimic breakpoints.
Since you don't have to recompile your code each time, as you would have if you didn't use an interpreted language, I would say this is acceptable.
Another option may be the following link to the Oreilly FTP server, where you can download from some wrapper code that acts as a debugger for the Kornshell.
Just get the tarball from there:
ftp://ftp.oreilly.com/published/oreilly/nutshell/ksh/
But if you want to do some more serious scripting none of the Unix shells is really an option IMHO because they all lack the possibility to modularize the code.
In the long run you alway end up cutting and pasting bits ad nauseam.
Thus, I would advise to spend some time in getting to know Perl.
It really pays, and with Perl you still can do (almost) all what you would do from shell scripts.