LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-01-2010, 12:55 PM   #1
namita m
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Post code not working


plz help me.....how to copy 2 files to another blank file.

echo -n "enter ur first file"
read f1
echo -n "enter 2 file'
read f2
'cp $f1 ,$f2 to $newfile'
echo "output is $newfile

i am not getting correct answer,is this code is correct..i want to copy the contents of f1 and f2 to newfile,but the code is not working getting syntax error.
 
Old 11-01-2010, 01:09 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
What is this?
Quote:
'cp $f1 ,$f2 to $newfile'
Read:
Code:
man cp
man cat

Last edited by eSelix; 11-01-2010 at 01:11 PM.
 
Old 11-01-2010, 01:13 PM   #3
udaman
Member
 
Registered: Oct 2010
Location: New England, USA
Distribution: OpenSUSE/Slackware64/RHEL/Mythbuntu
Posts: 187

Rep: Reputation: 39
Read each line of your code very carefully, and look for bad punctuation.

The 'cp' command is not what you want. Try something else that you covered in class.

I've made your script work, but you need to try it again.
 
Old 11-01-2010, 02:34 PM   #4
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Try cat file1 file2 >> newfile. I think I am right here.
Let me know what happens.
 
0 members found this post helpful.
Old 11-01-2010, 02:35 PM   #5
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Another suggestion...

Try cat file1 file2 >> newfile. I think I am right here.
Let me know what happens.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html code not working.... linuxlover.chaitanya Linux - Newbie 16 02-12-2009 01:30 AM
ALSA Duplex Working code Santosh_2839 Linux - Software 0 09-26-2008 07:55 AM
SED - minor changes work - Larger doesn't (working and non working code included) Nimoy Programming 17 09-22-2007 04:34 PM
Symlink to share code not working Parcye Programming 2 02-02-2007 02:05 AM
Why this code isn't working?? Script crazygyhrous Linux - Networking 5 12-19-2005 08:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration