LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   redirecting input from two files (https://www.linuxquestions.org/questions/linux-newbie-8/redirecting-input-from-two-files-745746/)

zhjim 08-07-2009 02:30 AM

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

GlennsPref 08-07-2009 03:20 AM

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

zhjim 08-07-2009 03:33 AM

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


All times are GMT -5. The time now is 04:43 PM.