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
redirection DNAx86 Shell Programming and Scripting 9 04-18-2008 11:24 AM
sed redirection myle UNIX for Dummies Questions & Answers 3 03-12-2008 04:04 PM
Complex Pipeline/Redirection/Regular Expression problem netmaster UNIX for Dummies Questions & Answers 1 11-28-2005 09:55 PM
Redirection Problem vibhor_agarwali UNIX for Dummies Questions & Answers 7 07-14-2005 03:01 AM
facing a problem in redirection vivekshankar UNIX for Dummies Questions & Answers 4 05-23-2005 09:24 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-06-2007
Registered User
 

Join Date: Sep 2007
Posts: 163
redirection problem

Hello Experts,


I am facing the following problem ..

Code:
>cat my_file
prints

initial begin
StartSim;
LDR(on); // Lock Detect Enable


But when I trying the same with the following command it shows me all the line in the same line.Like

Code:
>echo `cat my_file`
initial begin StartSim; LDR(on); // Lock Detect Enable

Is there any way around to print it as in my input file .. to the output file.
Thanks in advance..

Last edited by user_prady; 12-09-2007 at 11:46 PM.
Reply With Quote
Forum Sponsor
  #2  
Old 12-07-2007
sysgate's Avatar
Unix based
 

Join Date: Nov 2006
Location: /root
Posts: 1,200
echo "`cat cattest`\n" wil honor the new line.
Reply With Quote
  #3  
Old 12-09-2007
Registered User
 

Join Date: Sep 2007
Posts: 163
Quote:
Originally Posted by sysgate View Post
echo "`cat cattest`\n" wil honor the new line.
Thanks for the reply. But I am afraid its not working in my shell.<tcsh>........
Reply With Quote
  #4  
Old 12-09-2007
Moderator
 

Join Date: Dec 2003
Location: /dev/fl
Posts: 1,061
What exactly are you trying to achieve with this code? Your code makes no sense.
Reply With Quote
  #5  
Old 12-09-2007
Registered User
 

Join Date: Sep 2007
Posts: 163
Quote:
Originally Posted by fpmurphy View Post
What exactly are you trying to achieve with this code? Your code makes no sense.
Thanks for the Reply..

I want to do some thing like this

Code:
#! /bin/sh

for temp in `find ./CSV/ -name  "*.file"` 
do
   fname=`basename $temp`

   echo "Line 1 " >  ./out/$fname
   echo "Line 2 " >>  ./out/$fname
   ........
   echo "Line 100"  >>  ./out/$fname
   
   ./transform.sh $temp  >>  ./out/$fname
done
But instead of echoing each line I need I put those lines to a file and calling it by cat command
like echo `cat morelines`

Thanks in advance .
If any other method to do it better most appriciated..
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:21 AM.


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

Content Relevant URLs by vBSEO 3.2.0