The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
adding spaces for a variable value dnat Shell Programming and Scripting 2 02-26-2008 01:32 AM
Adding spaces to record nvenkat010 Shell Programming and Scripting 3 01-28-2008 09:24 AM
Adding an extra route to the ip routing table Japie89 IP Networking 2 10-18-2007 04:16 PM
adding spaces to a line mgirinath Shell Programming and Scripting 4 03-23-2007 08:38 AM
Adding Trailing Spaces to a file 222001459 UNIX for Dummies Questions & Answers 1 11-04-2004 11:23 AM

Reply
 
LinkBack Thread Tools Display Modes
  #15 (permalink)  
Old 05-19-2008
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 371
Quote:
Originally Posted by Raynon View Post
What is the sed portion trying to do ?
Can your code be used if the input is not a square matrix ?
It reverse the order of the file, and works in a not square input:

Code:
> cat file
D  H  -  -  G  -
C  G  K  -  I  Z
B  -  L  -  K  X
A  E  I  -  -  J
Code:
> sed -ne '1!G;h;$p' file
A  E  I  -  -  J
B  -  L  -  K  X
C  G  K  -  I  Z
D  H  -  -  G  -
Reply With Quote
Forum Sponsor
  #16 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 307
Thanks alot Klashxx, that's really creative by using transpose.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0