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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-07-2007
user_prady user_prady is offline
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-10-2007 at 02:46 AM..
  #2 (permalink)  
Old 12-07-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,318
echo "`cat cattest`\n" wil honor the new line.
  #3 (permalink)  
Old 12-09-2007
user_prady user_prady is offline
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>........
  #4 (permalink)  
Old 12-09-2007
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
What exactly are you trying to achieve with this code? Your code makes no sense.
  #5 (permalink)  
Old 12-10-2007
user_prady user_prady is offline
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..
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 11:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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