Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enter multiple filenames into 'stage' command

Status
Not open for further replies.
Feb 12, 2002
80
NO
Hi,

Any one know how to feed in a list of file names into the stage command rather than give an entire directory?

If you do no know what 'stage' is (like me!), basically I'm trying to create a script that takes a list of file names that are contained in an input file:

Code:
file1.txt
file_a.txt
anotherfile.log
and use this list of files to create the following command"
Code:
stage -w file1.txt file_a.txt anotherfile.txt
I beive there is a general way in UNIX to do this, something like
Code:
stage -w "{%input.file}"
I don't know how to do this though - any ideas?!

Cheers,
lil
 
I have no idea what the stage command is.

However, if the stage process works like other unix utilities try this


stage -w < input.file


JRjr
[morning]
 
In a ksh-like shell:
stage -w $(<input.file)

In a bourne-like shell
stage -w `cat input.file`

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks PHV.

I am about to check this myself, but for the purpose of this post:

My input file for this command has an additional extension on it (.stage).

So if my input_file is "L-33.txt", my 'stage' inut file will be "L-33.txt.stage"

So in this case, I guess your suggestion would become:
stage -w $(<{input.file}.stage)

Have I got that right? I know this is the kinda thing that could eat up hours of my time getting right!
 
stage -w $(sed 's!$!.stage!' input.file)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OOps, seems I've misunderstood the issue.
My last suggestion add the .stage extension to all filenames contained in the input file.

So, you have a shell variable named input_file which value is "L-33.txt" ?
stage -w $(<${input_file}.stage)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
ah ha!

yes - that seems to be working now ... well, it's doing something more logical anyway ...

Thanks for your help - very much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top