Redirect question


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Redirect question
# 1  
Old 06-24-2006
Data 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  
Old 06-24-2006
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  
Old 06-24-2006
Thanks Jim.
Its not what i meant but it help me .
Thanks Again.
Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

.htaccess redirect with #

I have the following directive in my .htaccess: #RewriteRule ^mozrank/?$ "http://www.seobook.com/#a_aid=dh" The problem is that the redirect is going to http://www.seobook.com/%23a_aid=dh How to preserve the # when redirecting? (2 Replies)
Discussion started by: rlopes
2 Replies

2. Web Development

URL Redirect

Just want to give a background. Currently, our company web site is redesigned and there are about 200 current URLs will have new redirects. I don't want to enter them in the config file rather would like to have them in a text file/config file and referring the file from the config whenever the... (2 Replies)
Discussion started by: jawak
2 Replies

3. Shell Programming and Scripting

Redirect Problem

Hi, I have perl script which is calling an external command using "system()" with argument. But i am not able to capture the output.Even tried with backtick also with no luck. . . $number=<>; system ("cmd $number >output.txt"); (2 Replies)
Discussion started by: rasingraj
2 Replies

4. UNIX for Dummies Questions & Answers

Sendmail MX redirect

Hi I have a working sendmail setup for my domain, but would like to run a subdomain on another machine. I could try below, but its a production server and worry about messing it up. Hence the question. So I have machine names: mydomain.com (mail server) dev.mydomain.com currently the... (1 Reply)
Discussion started by: gtrava01
1 Replies

5. UNIX for Dummies Questions & Answers

beginner redirect question

How can I redirect all stdout and stderr messages from a command to /dev/null (or to a file if need be) except messages that start with the word 'foo'? Messages that start with 'foo' need to be displayed in real time (i.e., when they are sent to stdout/stderr by the command). Thanks. (5 Replies)
Discussion started by: darwin_886
5 Replies

6. Shell Programming and Scripting

redirect after the diff

hi, i have 2 file of the same kind file_old and file_new there are few extra things added in new file i want to make diff file_old file_new > file_update ( file_update are the new things added as compare to the old file ) i can i make it clearly . bcoz in diff it show all the... (8 Replies)
Discussion started by: mail2sant
8 Replies

7. UNIX for Dummies Questions & Answers

How do I redirect a folder to another?

I'm having some space issues on one of my UNIX systems. How can I redirect a folder on one volume to a folder on another volume with more space? (5 Replies)
Discussion started by: bbbngowc
5 Replies

8. UNIX for Dummies Questions & Answers

Question from a newbie. How to redirect standard output

I have a program that is sending error text to the console and I need to redirect that output to a log file. I'm brand new to Unix and don't know how to do this. Any direction would be greatly appreciated. (1 Reply)
Discussion started by: ndemos
1 Replies

9. UNIX for Advanced & Expert Users

redirect connection

I have two UX servers ( eg. Server A , Server B ) , the users use Netterm as emulator to telnet to connect to these servers , each server have assigned a dedicated IP address ( eg. Server A --> 192.168.1.1 , Server B --> 192.168.1.2 ) , now if a user want to connect Server A , he need to telnet to... (1 Reply)
Discussion started by: ust
1 Replies

10. IP Networking

Redirect

I'm sittig behind a firewall that doesn't allow ftp. I have a conection to a UNIX system, connecting throug SSH. Is it possible to redirect the ftp through the UNIX to my computer? (1 Reply)
Discussion started by: <Therapy>
1 Replies
Login or Register to Ask a Question