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
Cannot redirect ouput????? minifish Shell Programming and Scripting 3 02-20-2008 12:15 PM
Question from a newbie. How to redirect standard output ndemos UNIX for Dummies Questions & Answers 1 07-27-2007 10:28 AM
PHP Redirect perleo Shell Programming and Scripting 2 05-11-2003 11:17 AM
Redirect Xterm barisgultekin UNIX for Dummies Questions & Answers 1 07-18-2002 01:33 PM
Redirect <Therapy> IP Networking 1 03-20-2002 08:54 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 06-24-2006
yoavbe yoavbe is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 42
Unhappy Redirect question

Hi,

I need some help to achive the follwoing task:
I have a file named test that contain the following line:
'Hellow world','good morning'

I want to attach the content of this file to a variable named var , and then rediarect it to a second file bamed test_new.
The result should look like this:

var='Hellow world','good morning'

Regards
  #2 (permalink)  
Old 06-24-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Your requirements are not clear to me.
Code:
cp test test_new
does what you ask instead of this which does what I think you said -
Code:
#!/bin/ksh
var=$(cat test)
echo "$var" > test_new
  #3 (permalink)  
Old 06-24-2006
yoavbe yoavbe is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 42
Thanks Jim.
Its not what i meant but it help me .
Thanks Again.
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:03 AM.


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