I want to use a directory name as a parameter for a pre-made script. Then the output goes into a newly made file in the home directory. It involves pipe/redirection. How do I do that?
read dir
$dir > script > outputfile
I want to use a directory name as a parameter for a pre-made script. Then the output goes into a newly made file in the home directory. It involves pipe/redirection. How do I do that?
|
||||
If you want to use the directory name as-is in your script, pass it as a parameter:
You can't redirect a directory to a script, what do you expect to see as the input? The name? The names of the directory entries? The contents of the directory entries? etc. I'm assuming as you're writing scripts, you know how to process a parameter. What exactly are you trying to accomplish? Show the script. It's not a homework assignment, is it? |
|||
|
script < $dir > ~/outputFile
. Here~
is the home directory. – user2555595 Sep 28 '14 at 6:07