Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-07-2009, 02:30 AM   #1
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

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
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,372
Blog Entries: 33

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


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


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

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

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.



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
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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 PM.

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