1. Passing File Names w/Paths Via command_line

I am creating a program to emulate a korn shell script I made that uses a 
parameter file (i.e. *.ini file) that is listed following the program name. The
korn shell script -- named 'ver_daily' -- is called in the following way:

/prod/data/bin/ver_daily /prod/data/parm/ver_daily.prm

The second parm - $2 - is the name of the parameter file the ksh script file 
gets its parameters from. In Euphoria, how can I provide users with the ability
to list a parameter file name along with its path without requiring them to 
enter back-slashes before each slash? 

/prod/data/bin/ver_daily \/prod\/data\/parm\/ver_daily.prm

Likewise, if the program ran on an NT 
environment, how could I code with command_line to avoid users having to enter
double back-slashes? 

C:\prod\data\bin\ver_daily C:\\prod\\data\\parm\\ver_daily.prm 

Dave

new topic     » topic index » view message » categorize

2. Re: Passing File Names w/Paths Via command_line

Dave Bunch wrote:
> 
> I am creating a program to emulate a korn shell script I made that uses a 
> parameter file (i.e. *.ini file) that is listed following the program name.
> The
> korn shell script -- named 'ver_daily' -- is called in the following way:
> 
> /prod/data/bin/ver_daily /prod/data/parm/ver_daily.prm
> 
> The second parm - $2 - is the name of the parameter file the ksh script file
> 
> gets its parameters from. In Euphoria, how can I provide users with the
> ability
> to list a parameter file name along with its path without requiring them to
> 
> enter back-slashes before each slash? 
> 
> /prod/data/bin/ver_daily \/prod\/data\/parm\/ver_daily.prm
> 
> Likewise, if the program ran on an NT 
> environment, how could I code with command_line to avoid users having to enter
> double back-slashes? 
> 
> C:\prod\data\bin\ver_daily C:\\prod\\data\\parm\\ver_daily.prm 
> 
> Dave

You don't need to do that at all.

For starters, the '/' character doesn't need being escaped.

Second, coding '\' as \\ applies *only* to manifest strings read by the Euphoria
interpreter from an Euphoria source file as it parses it. If the string is only
read by the executable which ex* created, in memory or on a storage medium, there
is no need to escape anything. You appear to be in the latter case.

CChris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Passing File Names w/Paths Via command_line

I didn't bother to test this...trying to save myself some trouble beforehand.

At least you didn't respond with "RFM".

Thanks,

Dave

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu