Re: I need some ideas on how to go about creating files....



On Jun 28, 7:32 pm, Eric Sosman <esos...@xxxxxxxxxxxxxxxxxxx> wrote:
K-mart Cashier wrote:
Program A reads in a file. However, Program A dictates the the person
creates an input file. After the person creates the file, they have to
change the following lines to the path of the file they created.

#define PATH "/home/calten/run/data"

Now, there has to be some better way than just having the user edit
the source code and recompile it everytime they want to change the
file name.

I'm sure there is something pretty obvious that I missed. Ideas?

Input redirection, command-line arguments, environment
variables, prompt-and-response, ...

--
Eric Sosman
esos...@xxxxxxxxxxxxxxxxxxx

I'm not too sure how I would go about this using environment
variables. I guess it's time for me to crack out "Unix Programming for
minimum wage clerks that got rejected twice by UC-Berkeley."

.



Relevant Pages

  • Re: I need some ideas on how to go about creating files....
    ... creates an input file. ... the source code and recompile it everytime they want to change the ... minimum wage clerks that got rejected twice by UC-Berkeley." ... use standard shell facilities to make it work with different files, ...
    (comp.unix.programmer)
  • Re: sed replace by enviroment var content
    ... Chris F.A. Johnson wrote: ... >> I want to use sed to read a piece of text and replace some strings by ... >> the value of that in the environment. ... >> The input file looks like this: ...
    (comp.unix.shell)
  • Re: Variable Length Input File
    ... environment LIKE this one because this environment was not then available, ... input file that was fixed block but depending on the day could have ... I have file called TESTA. ...
    (comp.lang.cobol)
  • Re: I need some ideas on how to go about creating files....
    ... creates an input file. ... the source code and recompile it everytime they want to change the ... I guess it's time for me to crack out "Unix Programming for ... minimum wage clerks that got rejected twice by UC-Berkeley." ...
    (comp.unix.programmer)
  • Re: sed replace by enviroment var content
    ... > the value of that in the environment. ... > The input file looks like this: ... > The shell should get the value of the parameter, but sed FIRST has to ... Shell Scripting Recipes: | My code in this post, if any, ...
    (comp.unix.shell)