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
Display mutiple line in single line manosubsulo Shell Programming and Scripting 4 11-11-2008 11:44 PM
I would like to separate a line and display accordingly.. suri.tyson Shell Programming and Scripting 6 09-25-2008 07:13 AM
display lines after a particular line number rajashekar.y UNIX for Dummies Questions & Answers 6 01-03-2007 03:53 AM
Display a particular line from a file Rohini Vijay Shell Programming and Scripting 5 07-31-2006 07:27 AM
Display Printers via command line gseyforth Windows & DOS: Issues & Discussions 3 06-28-2006 01:02 AM

Closed Thread
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 01-05-2009
ma466 ma466 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 21
Display Line numbers

Hi all experts,

I am getting error in my shell scripts and i want to find out which lines is in errors. How i can display the line numbers . Is it NU command? Please give me some suggestions.

Last edited by joeyg; 01-05-2009 at 12:28 PM.. Reason: Corrected spelling
  #2 (permalink)  
Old 01-05-2009
Ikon's Avatar
Ikon Ikon is offline Forum Advisor  
Registered User
  
 

Join Date: Jul 2008
Location: Phoenix, Arizona
Posts: 669
Code:
sed = filename | sed 'N;s/\n/\t/'

or

sed = filename | sed 'N; s/^/     /; s/ *\(.\{6,\}\)\n/\1  /'

Last edited by Ikon; 01-05-2009 at 11:22 AM..
  #3 (permalink)  
Old 01-05-2009
ma466 ma466 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 21
Thanks.
  #4 (permalink)  
Old 01-06-2009
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,047
Code:
cat -n filename
  #5 (permalink)  
Old 01-06-2009
the wonderer the wonderer is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 5
I am not sure which shell you are using, I am assuming it is bash shell.

You can try the following to debug your script:

Code:
bash -v myscript
or :

Code:
bash -x myscript
Sponsored Links
Closed Thread

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 09:40 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