- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Where to find one shell script editor
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
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
тАО07-09-2002 10:52 PM
тАО07-09-2002 10:52 PM
Where to find one shell script editor
I am a freshman towards shell script programming. Recently I have written a shell script which is about 300 sentences long. I just know to write a file with shell commands and then execute it directly under the current shell. Then some grammar errors occur. Grammar errors are relatively easy to position and correct but unfortunately there is some logical erros which are not easy to find without some tool aid. When I write C, I can find those logical errors easily with breakpoint or single step, etc. So I wonder whether there is some tools for shell programming providing the similar functions just as Turbo C. How and where can I get it? Thanks a lot!
Al.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-09-2002 10:54 PM
тАО07-09-2002 10:54 PM
Re: Where to find one shell script editor
When you run your script use the -x option and it will echo you every single line as it executes it so you can spot errors immediately.
eg.
sh -x ./<script> | more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-10-2002 11:43 PM
тАО07-10-2002 11:43 PM
Re: Where to find one shell script editor
Just a small extension to the answer of Stefan.
if you use a tee in the pipe this will alow you to create a logfile. So you are able to read easily each script line and it's corresponding output.
In addition you can use the produced file for documentation ( if needed)
command will be then :
sh -x ./<script> | tee script.log | more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2002 12:34 AM
тАО07-11-2002 12:34 AM
Re: Where to find one shell script editor
thereis nothing better than vi. but as already replied
sh -x <script> 2>&1 will give some info
insert some sleep or accepting input statements so that u can track.
regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2002 04:07 AM
тАО07-11-2002 04:07 AM
Re: Where to find one shell script editor
Copy the busted piece of code to new, just to make sure it works the way I expect. Divide and conquer. When it works I copy it back into the program.
Add lines like this to the code....
#-----debugging-----------
echo "VAR should be skippy"
echo "VAR is $VAR"
echo "hit return to continue......"
read bogus_var
#-----debugging-----------
I get rid of the lines when it works right.
When I run the code I....
sh -xv myprog.sh 2>myprog.debug
Then vi file myprog.debug