LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 08-07-2009, 02:30 AM   #1
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
redirecting input from two files


Hi folks,

I'm wondering if its possible to get the redirected input from two files. Something like this

Code:
mysql -p < ./setvariables < ./setdata
Also this does not give out an error. The only ouput I get on the screen is from the second command inside setdata.
How to interpret this. Is the first file also parsed but just not displayed?
Anyone knowing a way to get the input from two files in a row? And please no just cat the second file into the end of the first one. I don't want to cat 1Gb of data


Cheers Zhjim

Last edited by zhjim; 08-07-2009 at 03:31 AM. Reason: now should be no
 
Old 08-07-2009, 03:20 AM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, point the arrows to the output, put the output file last.

(concatenate)

cat source-file1 source-file2 > output-file-name

ref. http://docs.sun.com/app/docs/doc/816-5165/cat-1?a=view

hth, Glenn
 
Old 08-07-2009, 03:33 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748

Original Poster
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
I fouled around my self some more. And after reading your post it just came to me

Code:
cat ./setargs ./setdata | mysql -p
does the trick. Also I did not want to use cat I think it does not realy matter if the files is read in through redirection or piped after beeing cat.

Thanks
 
  


Reply



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
Redirecting to Files and STDIN ahmedb72 Linux - Newbie 1 07-01-2009 04:01 AM
Bash scripting: redirecting input to a command hal8000b Programming 2 12-10-2007 07:29 AM
Redirecting input for ssh... Lenux78 Linux - General 3 10-24-2006 01:00 PM
Input redirecting Thomas Ene Linux - Newbie 4 03-30-2006 12:16 AM
Automating tasks by redirecting input lsgko Linux - Software 4 02-26-2006 11:47 PM

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

All times are GMT -5. The time now is 04:43 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
Open Source Consulting | Domain Registration