Re: flexible filenames?



In article <hrb4k.131424$Ex2.93657@xxxxxxxxxxxxx>,
Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx> wrote:
On 2008-06-06, merritt@xxxxxxxxxxxxxxxxxxxxxxxxxxx <merritt@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Yes, certainly. Here is a simple example that show 2 possible
command variants for defining the file names.

N = 1
outfile = "graph_dim".N.".eps"
infile = sprintf("data_dim%02d.eps",N)

set output outfile
plot infile ....

Thanks for this interesting suggestion. I do however also sometimes use
the ! symbol to escape to my shell. And in the commands after
the ! symbol i would also like to use the above principle of
dynamically building up my filenames.

Consider the following example:


s=8

! echo s
! echo $s
! echo sprintf("%02d", s)

None of the above three echo commands shows the value for s. How would
i do that?
The ! mechanism is the wrong way to go. Use the system() command instead.

command = "echo ".s
system(command)

--
Ethan A Merritt
.



Relevant Pages

  • Re: Persisting env vars in cmd windows
    ... more about batch files as you go on, ... echo The time is %time::=.% ... But the piece de resistance was the "start" command, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... But the piece de resistance was the "start" command, ... - Have all code for the one project in one single batch file. ... @echo off ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... even though it applies to any command, e.g. echo, copy, ... Similarly the syntax for the extremely powerful "for" command ... more about batch files as you go on, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... even though it applies to any command, e.g. echo, copy, ... Similarly the syntax for the extremely powerful "for" command ... more about batch files as you go on, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... I open several Command windows in succession. ... Drag the name of C000_CreateSymbols.bat into a new command window ... @echo off ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)