The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
writing shell script to find line of invalid characters beginner82 Shell Programming and Scripting 3 06-04-2009 08:51 AM
shell script to find and replace a line using a identifier kenray Shell Programming and Scripting 7 05-06-2009 09:28 AM
find previous line, next line on solaris anduzzi Shell Programming and Scripting 1 02-18-2009 07:18 PM
find pattern delete line with pattern and line above and line below nickg UNIX for Dummies Questions & Answers 1 01-28-2009 06:46 PM
Script to find the number of tab delimiters in a line poornimajayan UNIX for Dummies Questions & Answers 5 09-29-2008 10:36 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-27-2009
srivat79 srivat79 is offline
Registered User
  
 

Join Date: May 2009
Posts: 6
Find the line/line of a script that is exceuted

Hello all,

how can i get the line/line number from a script that is being executed. Its not running in a verbose mode.

Unable to get them using ps command.

Anyone to help on this.


Thnx
Sri
  #2 (permalink)  
Old 05-27-2009
devtakh devtakh is offline
Registered User
  
 

Join Date: Oct 2007
Location: Bangalore
Posts: 514
Code:
set -x
in the begining of the script
  #3 (permalink)  
Old 05-27-2009
srivat79 srivat79 is offline
Registered User
  
 

Join Date: May 2009
Posts: 6
Thanks.

As this on Production, a unable to set it as verbose or run with "sh -vx".

All i need to know is find the line in the script that is getting executed.

Thanks
  #4 (permalink)  
Old 05-27-2009
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
You could change it's output to a more verbose mode using
Code:
set -x
and watch the output to your screen or logfile.
Commands that are invoked for a very short time might be already terminated before you get your ps running.
To not get too much output you can use
Code:
set +x
to stop the verbose output.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0